From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: emacs-26 c87d04e: Avoid aborts in 'md5' Date: Wed, 28 Feb 2018 14:14:46 -0800 Organization: UCLA Computer Science Department Message-ID: References: <20180227164448.16622.42058@vcs0.savannah.gnu.org> <20180227164448.E4B45207B1@vcs0.savannah.gnu.org> <87h8q15xdo.fsf@gmx.de> <87606h5vlm.fsf@gmx.de> <83inahyuq9.fsf@gnu.org> <83606hyqlw.fsf@gnu.org> <2ec62b62-7d0e-c0a5-6139-739f9b5a4206@cs.ucla.edu> <83woywyhri.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1519856016 26105 195.159.176.226 (28 Feb 2018 22:13:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Feb 2018 22:13:36 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 Cc: schwab@suse.de, michael.albinus@gmx.de, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 28 23:13:31 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1er9yd-0006Mi-F0 for ged-emacs-devel@m.gmane.org; Wed, 28 Feb 2018 23:13:31 +0100 Original-Received: from localhost ([::1]:47306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erA0e-0002Hu-8B for ged-emacs-devel@m.gmane.org; Wed, 28 Feb 2018 17:15:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erA01-0002GG-Ol for emacs-devel@gnu.org; Wed, 28 Feb 2018 17:15:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1er9zy-0000du-Oh for emacs-devel@gnu.org; Wed, 28 Feb 2018 17:14:57 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:33694) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1er9zu-0000UA-FQ; Wed, 28 Feb 2018 17:14:50 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id D33E2161610; Wed, 28 Feb 2018 14:14:47 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id T41XGgthonF5; Wed, 28 Feb 2018 14:14:47 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 21A2016161A; Wed, 28 Feb 2018 14:14:47 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hcuFQO_5_UOk; Wed, 28 Feb 2018 14:14:47 -0800 (PST) Original-Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 08242161610; Wed, 28 Feb 2018 14:14:47 -0800 (PST) In-Reply-To: <83woywyhri.fsf@gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:223182 Archived-At: On 02/28/2018 12:35 PM, Eli Zaretskii wrote: > That's not what I meant. I meant that as long as the code is frozen > in its current form, nothing is gained by omitting 'else'. I'm puzzled, since my patch inserts 'else', and yet you appear to be objecting to it on the grounds that nothing is gained by omitting 'else'. I must be misunderstanding. > we always check STRINGP before using SBYTES or SSDATA Only if there's some possibility that the object is not a string. In general, Emacs C functions very often use SBYTES or SDATA without first checking STRINGP, because they are in contexts where the object must be a string. For fun I just now looked at print.c, and none of the first ten occurrences of SDATA or SSDATA were protected by STRINGP. And that's OK, since none of these occurrences needed STRINGP. For the case we're talking about, it's not possible for the object to be a string, so although it might be appropriate to have an eassert (STRINGP (...)) to verify that the impossible does not happen (to help future-proof the code, say), we shouldn't need a runtime check in production code.