stack-allocated indirect closure variables are not popped
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Alastair Bridgewater |
Bug Description
(defun bug419 (x)
(eval '(values 1 2 3))
(let ((x x))
(flet ((mget (y)
(ASSERT (EQUAL (BUG419 42) '(1 2 3 4 5 6))) => failure
Note: as of SBCL 1.0.16.29 this bug no longer affects user code, as
SB-INT:
DYNAMIC-EXTENT for this to happen. Proper fix for this bug requires
(Nikodemus thinks) storing the relevant LAMBDA-VARs in a
:DYNAMIC-EXTENT cleanup, and teaching stack analysis how to deal
with them.
Changed in sbcl: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in sbcl: | |
assignee: | nobody → Alastair Bridgewater (alastair-bridgewater) |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
Since equivalent constructs such as
(defun bug419/good (x) value-call #'list truly-dynamic- extent x))
(incf (car x) z)))
(multiple-
(eval '(values 1 2 3))
(let ((x (list x)))
(declare (sb-int:
(flet ((mget (y)
(+ (car x) y))
(mset (z)
(declare (dynamic-extent #'mget #'mset))
((lambda (f g) (eval `(progn ,f ,g (values 4 5 6)))) #'mget #'mset)))))
works fine, an alternative strategy would be to implement DX value cells explicit objects (via a magic source transform, for example.)