Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix BARE-STRUCT-TYPE-P & STRUCTURE-BY-VALUE-P

  • Loading branch information...
commit aa0c8a77346707e4a12ff3ad8c2f1af4708d6b92 1 parent 14e4a58
@crlf0710 crlf0710 authored luismbo committed
Showing with 12 additions and 3 deletions.
  1. +8 −0 src/early-types.lisp
  2. +4 −3 src/functions.lisp
View
8 src/early-types.lisp
@@ -215,6 +215,14 @@ Signals an error if FOREIGN-TYPE is undefined."))
;;;# Structure Type
+(defgeneric bare-struct-type-p (foreign-type)
+ (:documentation
+ "Return true if FOREIGN-TYPE is a bare struct type or an alias of a bare struct type. "))
+
+(defmethod bare-struct-type-p ((type foreign-type))
+ "Return true if FOREIGN-TYPE is a bare struct type or an alias of a bare struct type. "
+ nil)
+
(defclass foreign-struct-type (named-foreign-type)
((slots
;; Hash table of slots in this structure, keyed by name.
View
7 src/functions.lisp
@@ -90,9 +90,10 @@
(defun structure-by-value-p (ctype)
"A structure or union is to be called or returned by value."
- (typep (follow-typedefs (parse-type ctype))
- '(or foreign-struct-type foreign-union-type
- #+cffi::no-long-long emulated-llong-type)))
+ (let ((actual-type (follow-typedefs (parse-type ctype))))
+ (or (and (typep actual-type 'foreign-struct-type)
+ (not (bare-struct-type-p actual-type)))
+ #+cffi::no-long-long (typep actual-type 'emulated-llong-type))))
(defun fn-call-by-value-p (argument-types return-type)
"One or more structures in the arguments or return from the function are called by value."
Please sign in to comment.
Something went wrong with that request. Please try again.