GNU bug report logs - #46387
28.0.50; Compiled code making a variable dynamic stopped working

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Mon, 8 Feb 2021 17:31:02 UTC

Severity: normal

Found in version 28.0.50

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: bug-gnu-emacs <at> gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: 28.0.50; Compiled code making a variable dynamic stopped working
Date: Wed, 10 Feb 2021 04:20:46 +0100
Mattias Engdegård <mattiase <at> acm.org> writes:

> As it turns out, parts of the implementation have different opinions
> about that. As you observed, the recently added optimisation on master
> takes a strict syntactic view: even a `progn` is a lexical scope, and
> `with-suppressed-warnings` wraps its body in a `progn`; thus your
> `defvar` declarations have no effect outside that construct.

Seems this is the related code change (took quite a while until I found
that):

83983b6b7a115474572973b62eb5e42251713e63
Author:     Mattias Engdegård <mattiase <at> acm.org>
AuthorDate: Sat Feb 6 18:34:45 2021 +0100

 (defun byte-optimize-body (forms all-for-effect)
   ;; Optimize the cdr of a progn or implicit progn; all forms is a list of
@@ -590,6 +763,7 @@ byte-optimize-body
   ;; all-for-effect is true.  returns a new list of forms.
   (let ((rest forms)
 	(result nil)
+        (byte-optimize--dynamic-vars byte-optimize--dynamic-vars)
 	fe new)
     (while rest
       (setq fe (or all-for-effect (cdr rest)))

Should that line just be removed?

TIA,

Michael.




This bug report was last modified 4 years and 100 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.