erronous COERCE type derivation in unsafe code

Bug #655872 reported by Nikodemus Siivola on 2010-10-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Unless SAFETY=3, (COERCE X '(VECTOR 5)) isn't oblidged to actually return a vector of length 5 -- just a vector.

Our DEFTRANSFORM for COERCE takes advantage of this, but the DERIVE-TYPE method for COERCE does not take this into account.

Either the DEFTRANSFORM has to be more conservative, or the DERIVE-TYPE needs to be more careful in unsafe code about the type it returns.


(funcall (compile nil
                  `(lambda (x)
                    (declare (optimize speed))
                     (let ((v (coerce x '(simple-vector 1024))))
                       (list (aref v 400) (aref v 500) (aref v 700) (aref v 1000)))))
         (vector t))

for all manner of excitement.

description: updated
Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
status: Triaged → In Progress
Nikodemus Siivola (nikodemus) wrote :


Changed in sbcl:
assignee: Nikodemus Siivola (nikodemus) → nobody
status: In Progress → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers