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-diffs] emacs-26 9bf66c6: Don't run FOR_EACH_FRAME when there's no frame left (Bug#29961) Date: Sat, 16 Dec 2017 16:50:48 -0800 Organization: UCLA Computer Science Department Message-ID: <9d0b9c22-d386-cd0a-3947-a44d58b1ee0e@cs.ucla.edu> References: <20171215073120.7671.79446@vcs0.savannah.gnu.org> <20171215073122.52703204D3@vcs0.savannah.gnu.org> <5A34119D.6000407@gmx.at> <5A34EA93.1050501@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1513471750 19982 195.159.176.226 (17 Dec 2017 00:49:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 17 Dec 2017 00:49:10 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 To: martin rudalics , Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 17 01:49:06 2017 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 1eQN8c-0004wo-Cb for ged-emacs-devel@m.gmane.org; Sun, 17 Dec 2017 01:49:06 +0100 Original-Received: from localhost ([::1]:52674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQNAa-0007ry-LU for ged-emacs-devel@m.gmane.org; Sat, 16 Dec 2017 19:51:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQNAQ-0007rd-UE for emacs-devel@gnu.org; Sat, 16 Dec 2017 19:50:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQNAN-00019m-Sb for emacs-devel@gnu.org; Sat, 16 Dec 2017 19:50:59 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:50822) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eQNAN-00018r-NO for emacs-devel@gnu.org; Sat, 16 Dec 2017 19:50:55 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id CCA85161387; Sat, 16 Dec 2017 16:50:53 -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 5HC_hQmXpiYV; Sat, 16 Dec 2017 16:50:53 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 117CB16147B; Sat, 16 Dec 2017 16:50:53 -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 i4A6S8YZfCdC; Sat, 16 Dec 2017 16:50:52 -0800 (PST) Original-Received: from [192.168.1.9] (unknown [47.154.30.119]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id DBBA416106A; Sat, 16 Dec 2017 16:50:52 -0800 (PST) In-Reply-To: <5A34EA93.1050501@gmx.at> 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:221163 Archived-At: martin rudalics wrote: > > I recognized callers that either --enable-gcc-warnings complained > > about (because code after the FOR_EACH_FRAME loop clearly had > > undefined behavior unless the loop iterated at least once), >=20 > Which ones were these? The code with undefined behavior is in delete_frame, after its 3rd use of= =20 FOR_EACH_FRAME. This loop head is of the form 'FOR_EACH_FRAME (tail, fram= e1)=20 ...' and the code after the loop assumes that frame1 is initialized, an=20 assumption that is false if Vframe_list is nil. > Neither next_frame nor prev_frame exhibit such behavior IMO. That's right. However, commit 8720f601e715e5f1d41f7cf863a525a1cc1bc12c re= moved=20 these functions' assertions that frame-list is non-nil, so I thought it w= ise to=20 resurrect them. > > and > > callers where historically there was an eassert that checked the > > assumption. >=20 > How far did you go back in history? To commit 8720f601e715e5f1d41f7cf863a525a1cc1bc12c, which is the commit t= hat=20 inserted the (now-removed) assumption that frame-list is non-nil when=20 FOR_EACH_FRAME is first executed.