From 619b17ce5eb96b3cfd5f2d94174270a31e46871c Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Tue, 19 Feb 2008 12:54:49 +0100 Subject: Reimplement slot reading. darcs-hash:bdef9c8f4c3fb2121456295da23fbe679265a15b --- Lisp/class-definition.lisp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Lisp/class-definition.lisp') diff --git a/Lisp/class-definition.lisp b/Lisp/class-definition.lisp index 6ecb189..e228c56 100644 --- a/Lisp/class-definition.lisp +++ b/Lisp/class-definition.lisp @@ -149,12 +149,14 @@ (effective-slot-definition foreign-effective-slot-definition)) (with-slots (foreign-name foreign-type) effective-slot-definition - ;; FIXME: Do proper value conversion here (like LOW-LEVEL-INVOKE). - (cffi:with-foreign-object - (return-value-cell (typespec->c-type foreign-type)) - (%objcl-get-slot-value (pointer-to instance) - foreign-name return-value-cell) - (mem-ref return-value-cell (typespec->c-type foreign-type))))) + (let ((slot-offset + (%objcl-get-slot-offset + (%objcl-get-slot (pointer-to class) foreign-name)))) + (convert-from-foreign-value (inc-pointer (pointer-to instance) + slot-offset) + foreign-type + nil + t)))) (defmethod (setf c2mop:slot-value-using-class) (value -- cgit v1.2.3