mirror of
git://git.code.sf.net/p/sbcl/sbcl
synced 2026-09-10 07:26:40 -04:00
Fix 18-year-old constant-folding bug on (get-lisp-obj-address fixnum)
Wrong ever since 6fa968aaa8 apparently
This commit is contained in:
parent
58b8222523
commit
7635130348
|
|
@ -787,7 +787,8 @@
|
|||
;;; VOP can't handle them.
|
||||
|
||||
(deftransform sb-vm::get-lisp-obj-address ((obj) ((constant-arg fixnum)))
|
||||
(ash (lvar-value obj) sb-vm:n-fixnum-tag-bits))
|
||||
(logand (ash (lvar-value obj) sb-vm:n-fixnum-tag-bits)
|
||||
sb-ext:most-positive-word))
|
||||
|
||||
(deftransform sb-vm::get-lisp-obj-address ((obj) ((constant-arg character)))
|
||||
(logior sb-vm:character-widetag
|
||||
|
|
|
|||
7
tests/lispobj.pure.lisp
Normal file
7
tests/lispobj.pure.lisp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
(defun transformed () (sb-kernel:get-lisp-obj-address -1))
|
||||
(defun not-transformed ()
|
||||
(declare (notinline sb-kernel:get-lisp-obj-address))
|
||||
(sb-kernel:get-lisp-obj-address -1))
|
||||
(compile 'transformed)
|
||||
(with-test (:name transform-get-lisp-obj-addresss)
|
||||
(assert (eql (transformed) (not-transformed))))
|
||||
Loading…
Reference in a new issue