Don't delete empty special bindings if there is dynamic-extent around.

The usual pain inflicted by the fickle dynamic-extent handling.

Reported by Eric Marsden.
This commit is contained in:
Stas Boukarev 2022-04-22 19:25:46 +03:00
parent d5600e36f2
commit 88d2bc458e
2 changed files with 15 additions and 1 deletions

View file

@ -5185,7 +5185,10 @@
(and succ
(block-start succ)
(neq (node-enclosing-cleanup node)
(block-start-cleanup succ)))))
(block-start-cleanup succ))))
(do-nested-cleanups (cleanup (node-lexenv node) t)
(when (eq (cleanup-kind cleanup) :dynamic-extent)
(return))))
(setf (lexenv-cleanup (node-lexenv node)) nil)
(flush-combination prev)
nil)

View file

@ -1683,3 +1683,14 @@
(lambda (j &rest points)
(apply continuation j (mapcar identity points)))))))
(() '(1 #()) :test #'equalp)))
(with-test (:name :special-bind-removal)
(checked-compile-and-assert
()
`(lambda (a)
(multiple-value-prog1 (eval a)
(let ((* (let ((x (list 1)))
(setf (car x) 1)
x)))
(declare (dynamic-extent *)))))
((1) 1)))