unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#42360: [feature/native-comp] miscompilation(?) of functions with non local exits
@ 2020-07-15  8:24 Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2020-07-15 14:25 ` Eli Zaretskii
  2020-07-15 19:17 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2020-07-15  8:24 UTC (permalink / raw)
  To: 42360; +Cc: Eli Zaretskii, Stefan Monnier

Due to a recent modification native-comp is (probably?) miscompiling
lexical scope functions with non local exits if they involve code with
side effect on local variables.  Before fixing I prefer to double check
the correct behavior we want.

Considering the following piece of (lexical scoped) code:

===
(let (x)
  (ignore-errors
    (setq x t)
    (error "foo"))
  x)
===

Three options:

  1- Because setq is evaluated the expression should always evaluate to
  t.

  2- Unwinding the original state of the stack is restored, when it was
  saved 'x' was nil so the expression should evaluate to nil.

  3- This is unspecified.

The current stock implementaion does always 1 so I'm prone to just go
for it but I wanted to double check to be on the safe side.

FYI 1 implies C register variables cannot be used to implement Lisp
local variable if non local exits are present.

Thanks

  Andrea

--
akrl@sdf.org





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-16 19:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-15  8:24 bug#42360: [feature/native-comp] miscompilation(?) of functions with non local exits Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-07-15 14:25 ` Eli Zaretskii
2020-07-15 19:17 ` Stefan Monnier
2020-07-15 21:19   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-07-16 19:47     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors

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).