Compiler incorrectly reasons about types of mutable data sometimes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
New
|
Undecided
|
Unassigned |
Bug Description
Steps to reproduce:
(defparameter *g* (cons 1 2))
(defun g () (setf (car *g*) 'a))
(defun f (x)
(when (typep x '(cons fixnum))
(g)
(if (typep x '(cons fixnum))
"Still cons fixnum!"
"Not cons fixnum")))
(print (f *g*))
;; EOF
Put this in a file, compile and load. It would print
"Still cons fixnum" while x is actually (not cons fixnum) at the moment of printing.
sbcl 1.4.0
Linux deb8 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1+deb8u1 (2017-02-22) x86_64 GNU/Linux
features were not changed:
(:64-BIT :64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS
:C-STACK-
:COMPARE-
:FP-AND-
:IMMOBILE-SPACE :INLINE-CONSTANTS :INTEGER-EQL-VOP :LARGEFILE :LINKAGE-TABLE
:LINUX :LITTLE-ENDIAN :MEMORY-
:OS-PROVIDES-
:OS-PROVIDES-
:OS-PROVIDES-
:RAW-INSTANCE-
:SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SOURCE-
:SB-THREAD :SB-TRACEROOT :SB-UNICODE :SBCL :STACK-
:STACK-
:STACK-
:UNBIND-N-VOP :UNDEFINED-
:X86-64)
Draft of a fix is here: /github. com/budden/ sbclt/commit/ e0529216934e824 769b85b3bd34866 099c371a75
https:/