SB-ALIEN violates type correctness
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
New
|
Undecided
|
Unassigned |
Bug Description
If SBCL is built without either evaluator, so that SB-ALIEN:
The failure occurs because COMPILE (as opposed to eval) obeys declarations - as does sb-fasteval which similarly fails, but which can be ruled out as the cause of the failure.
Specifically, in this test, COMPUTE-
;;; Test case
(define-
(define-
(defvar *outer* (make-alien outer))
(defvar *inner* (make-alien inner))
(setf (slot *inner* 'var) 20)
(setf (slot *outer* 'one) *inner*)
=>
debugger invoked on a TYPE-ERROR in thread
#<THREAD "main thread" RUNNING {1002A94D63}>:
The value
#<ALIEN-VALUE :SAP #X00644BF0 :TYPE (* (STRUCT INNER (VAR # :OFFSET 0)))>
is not of type
(ALIEN (STRUCT INNER (VAR (UNSIGNED 32) :OFFSET 0))).
Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1002A94D63}>
0: ((LAMBDA (VALUE SAP OFFSET IGNORE)) #<ALIEN-VALUE :SAP #X00644BF0 :TYPE (* (STRUCT INNER (VAR (UNSIGNED 32) :OFFSET 0)))> #.(INT-SAP #X00644BD0) 0 #<unavailable a\
rgument>)
1: ((SETF %ALIEN-VALUE) #<ALIEN-VALUE :SAP #X00644BF0 :TYPE (* (STRUCT INNER (VAR (UNSIGNED 32) :OFFSET 0)))> #.(INT-SAP #X00644BD0) 0 #<ALIEN-RECORD-TYPE (STRUCT IN\
NER (VAR (UNSIGNED 32) :OFFSET 0))>)
2: (SIMPLE-
3: (EVAL (SETF (SLOT *OUTER* (QUOTE ONE)) *INNER*))
Note that:
(type-of *inner*) => (ALIEN (* (STRUCT INNER (VAR (UNSIGNED 32) :OFFSET 0))))
And it works if you do: (setf (slot *outer* 'one) (DEREF *inner*))
I'm not sure whether that's supposed to be mandatory to deref the right hand side.
This is the same as https:/ /bugs.launchpad .net/sbcl/ +bug/734259