]> git.eshelyaron.com Git - emacs.git/commit
Fix constant folding of overflows
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 27 Mar 2018 00:03:54 +0000 (17:03 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 27 Mar 2018 00:04:38 +0000 (17:04 -0700)
commit66b771890189c8da2eabad7f2957a2dd0b2717f6
tree70e1a5d998e7ac4b48226184ed810516b344a2c5
parentc23f2b5d9e75ca0a8861043ec3d4114c89047b95
Fix constant folding of overflows

This suppresses some byte-code optimizations that were invalid in
the presence of integer overflows, because they meant that .elc
files assumed the runtime behavior of the compiling platform, as
opposed to the runtime platform.  Problem reported by Pip Cet in:
https://lists.gnu.org/r/emacs-devel/2018-03/msg00753.html
* lisp/emacs-lisp/byte-opt.el (byte-opt--portable-max)
(byte-opt--portable-min): New constants.
(byte-opt--portable-numberp, byte-opt--arith-reduce)
(byte-optimize-1+, byte-optimize-1-): New functions.
(byte-optimize-plus, byte-optimize-minus, byte-optimize-multiply)
(byte-optimize-divide): Avoid invalid optimizations.
(1+, 1-): Use new optimizers.
(byte-optimize-or, byte-optimize-cond): Simplify by using
remq instead of delq and copy-sequence.
lisp/emacs-lisp/byte-opt.el