Skip to content
Snippets Groups Projects
Commit 48511845 authored by wlott's avatar wlott
Browse files

Changed compute-call-form to check pointer return values for NULL. If

the returned pointer is NULL, return NIL instead of an alien.
parent d3f3f749
No related branches found
No related tags found
No related merge requests found
......@@ -528,9 +528,12 @@
(unless (c-type-size type)
(error "Can't return pointers to objects of unknown size: ~S"
(c-type-description return-type)))
`(make-alien ',(c-type-description type)
,(c-type-size type)
,(sub-compute-call-form 'system-area-pointer))))
(let ((sap (gensym "SAP-")))
`(let ((,sap ,(sub-compute-call-form 'system-area-pointer)))
(unless (zerop (sap-int ,sap))
(make-alien ',(c-type-description type)
,(c-type-size type)
,sap))))))
(array-type
(unless (c-type-size return-type)
(error "Can't return arrays of unknown size: ~S"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment