regression in alien compilation since 1.0.12 (?)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Nikodemus Siivola |
Bug Description
Reported by Ken Olum to sbcl-devel on Jan 5 2009:
I get the error "The value NIL is not of type SB-KERNEL:CTYPE" when
trying to compile a function that uses the values returned from an
inline function defined by DEFINE-
of "void" and an argument of type :OUT. For example compiling this file,
-------
(declaim (inline store))
(sb-alien:
(result char :out))
(defun do-store ()
(multiple-
-------
will generate the above error.
I am using X86-64. This happens in SBCL 1.0.23 and in 1.0.20, but not
in 1.0.12. It doesn't happen without the INLINE declaration. It
doesn't happen if I change void to int. If I macroexpand the
DEFINE-
(PROGN
(DECLAIM (FTYPE (FUNCTION NIL (VALUES NULL (ALIEN CHAR) &OPTIONAL)) STORE))
(DEFUN STORE ()
(WITH-ALIEN ((STORE (FUNCTION VOID (* CHAR)) :EXTERN "store") (RESULT CHAR))
If I evaluate only the defun, I don't get the problem. If I evaluate
the DECLAIM as well, then I do, even though the function does in fact
appear to have the given type.
Apart from whenever is causing the compiler problem, I think it would
be better if when the return type is "void" DEFINE-
did not return the extra NIL.
Changed in sbcl: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in sbcl: | |
assignee: | nobody → nikodemus |
Changed in sbcl: | |
status: | Confirmed → Fix Committed |
In 1.0.24.33 / 1.0.25.