]> git.eshelyaron.com Git - emacs.git/commit
Cease attempts to const-propagate through setq
authorMattias Engdegård <mattiase@acm.org>
Thu, 5 Aug 2021 09:50:25 +0000 (11:50 +0200)
committerMattias Engdegård <mattiase@acm.org>
Thu, 5 Aug 2021 13:33:05 +0000 (15:33 +0200)
commit2a17925aab75735b40f9b0ccaab4c46f6b9a9a32
tree9bf4f3c62e87cc85f7588626be46845afb19a1cb
parent2d8c14d299600c08751bfb978883c9f1b7141555
Cease attempts to const-propagate through setq

The current method of propagating constants through setq was unsound
because it relied on each setq form only being traversed at most once
during optimisation, which isn't necessarily true in general; it could
be made to miscompile code in rare cases.

Since it was only used in limited circumstances, disabling this
optimisation doesn't cost us much.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Don't update the known value when traversing `setq`.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test case.
lisp/emacs-lisp/byte-opt.el
test/lisp/emacs-lisp/bytecomp-tests.el