wanted: warnings about invalid usage of the variables which are declared to be within dynamic extent
Bug #589305 reported by
Roman Marynchak
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
SBCL 1.0.38. This code:
(defun f ()
(let ((x (list 1 2 3)))
(declare (dynamic-extent x))
x))
should warn the user about the invalid return of the stack-allocated variable X on compile time.
Regards,
Roman
Changed in sbcl: | |
status: | New → Confirmed |
Changed in sbcl: | |
importance: | Undecided → Medium |
To post a comment you must log in.
Yeah, that'd be really nice if it could figure out that the variable certainly doesn't have dynamic extent and tell you that you've screwed up.
Conversely, it would be nice if it could figure out that a variable certainly *is* dynamic-extent, and not require an explicit declaration. E.g. in:
(defun stupid+ (a b c)
(let ((x (list a b c)))
(reduce #'+ x))
it would be nice if it could automatically deduce that x can be stack allocated, because it knows it can't escape.