CTYPE leakage from SETQ
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
We splice CTYPEs in directly instead of using a type specifier when ir1 converting setq. Should we try and detect these meta-level leakage issues during ir1-conversion, or do we (want to) actively depend on that being possible?
Test case by Zach Beane:
;;;; foo.lisp
(defun foo ()
(let ((em 0d0))
(declare (type double-float em))
(dotimes (i 42)
(setf em (float (1+ i))))))
;;;; (compile-file "foo.lisp")
; compiling file "/tmp/foo.lisp" (written 15 NOV 2011 10:59:09 AM):
; compiling (DEFUN FOO ...)
; file: /tmp/foo.lisp
; in: DEFUN FOO
; (SETF EM (FLOAT (1+ I)))
; --> SETQ THE SB-C::%
; ==>
; '((THE #<SB-KERNEL:
; SB-KERNEL:
;
; caught ERROR:
; SB-KERNEL:
; --> SETQ THE
; ==>
; (SB-C::
; '(VALUES (SINGLE-FLOAT 1.0) &OPTIONAL)
; '((THE #<SB-KERNEL:
; (FLOAT (1+ I)))
; SB-KERNEL:
;
; note: The fourth argument never returns a value.
; (DOTIMES (I 42) (SETF EM (FLOAT (1+ I))))
; --> DO BLOCK LET TAGBODY PSETQ PSETF LET* MULTIPLE-VALUE-BIND LET 1+ +
; ==>
; I
;
; note: deleting unreachable code
;
; compilation unit finished
; caught 1 ERROR condition
; printed 2 notes
; /tmp/foo.fasl written
; compilation finished in 0:00:00.006
tags: | added: compiler-ir1 |
Changed in sbcl: | |
status: | In Progress → Fix Committed |
Changed in sbcl: | |
assignee: | Paul Khuong (pvk) → nobody |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
Fix committed in 5efae23 Plug a CTYPE leak into fasls via SETQ.