unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: martin rudalics <rudalics@gmx.at>,
	Stefan Monnier <monnier@IRO.UMontreal.CA>,
	emacs-devel@gnu.org
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	[thread overview]
Message-ID: <9d0b9c22-d386-cd0a-3947-a44d58b1ee0e@cs.ucla.edu> (raw)
In-Reply-To: <5A34EA93.1050501@gmx.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),
> 
> Which ones were these?

The code with undefined behavior is in delete_frame, after its 3rd use of 
FOR_EACH_FRAME. This loop head is of the form 'FOR_EACH_FRAME (tail, frame1) 
...' and the code after the loop assumes that frame1 is initialized, an 
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 removed 
these functions' assertions that frame-list is non-nil, so I thought it wise to 
resurrect them.

>  > and
>  > callers where historically there was an eassert that checked the
>  > assumption.
> 
> How far did you go back in history?

To commit 8720f601e715e5f1d41f7cf863a525a1cc1bc12c, which is the commit that 
inserted the (now-removed) assumption that frame-list is non-nil when 
FOR_EACH_FRAME is first executed.



  reply	other threads:[~2017-12-17  0:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20171215073120.7671.79446@vcs0.savannah.gnu.org>
     [not found] ` <20171215073122.52703204D3@vcs0.savannah.gnu.org>
2017-12-15 16:23   ` [Emacs-diffs] emacs-26 9bf66c6: Don't run FOR_EACH_FRAME when there's no frame left (Bug#29961) Stefan Monnier
2017-12-15 17:13     ` Paul Eggert
2017-12-15 18:17       ` martin rudalics
2017-12-15 19:09         ` Paul Eggert
2017-12-16  9:42           ` martin rudalics
2017-12-17  0:50             ` Paul Eggert [this message]
2017-12-17 10:46               ` martin rudalics
2017-12-18  0:39                 ` Paul Eggert
2017-12-18  7:26                   ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d0b9c22-d386-cd0a-3947-a44d58b1ee0e@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).