wanted: warnings about invalid usage of the variables which are declared to be within dynamic extent

Bug #589305 reported by Roman Marynchak
6
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
Revision history for this message
James Y Knight (foom) wrote :

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.

Revision history for this message
Roman Marynchak (roman-marynchak) wrote :

I agree with the reverse problem, but it is the completely different task from the implementation point of view. So, please report it as a separate issue, because in other case we will not be able to tell what is the progress on the first and on the second ones.

Changed in sbcl:
importance: Undecided → Medium
Revision history for this message
Douglas Katzman (dougk) wrote :

can't possibly be medium prio

Changed in sbcl:
importance: Medium → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.