alien alignment information not preserved during compilation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
High
|
Unassigned |
Bug Description
(sb-alien:
(sb-
(defun test (a)
(declare (type (sb-alien:alien (sb-alien:struct type-b)) a))
a)
; in: DEFUN TEST
; (SB-INT:
; (A)
; (DECLARE (TYPE (ALIEN (STRUCT TYPE-B)) A))
; (BLOCK TEST A))
; --> SB-C::%FUNCALL MULTIPLE-VALUE-BIND LET UNLESS IF
; ==>
; (TYPEP #:G6 '(ALIEN (STRUCT TYPE-B (A (UNSIGNED 64)) (B (UNSIGNED 64)))))
;
; caught WARNING:
; illegal type specifier for TYPEP: (ALIEN
; (STRUCT TYPE-B (A (UNSIGNED 64))
; (B (UNSIGNED 64))))
;
; compilation unit finished
; caught 1 WARNING condition
And calling it:
(test 1)
Incompatible alien record type definition
Old: (STRUCT TYPE-B (A (UNSIGNED 64)) (B (UNSIGNED 64)))
New: (STRUCT TYPE-B (A (UNSIGNED 64)) (B (UNSIGNED 64)))
(SB-ALIEN:
in the backtrace suggest that it doesn't save and pass alignment information.
tags: | added: review |
Not sure if this is the right thing, but the attached patch squirrels away the offset information in the alien type and uses this in parse-alien- record- fields to regenerate the type.