[cffi-devel] Problem with conc-name, dumping CFFI::AGGREGATE-STRUCT-SLOT
Compare the definitions of the structures WORKING and BROKEN: (use-package :cffi) (defcstruct foo (x :int)) (defcstruct working (y foo)) (defcstruct (broken :conc-name broken-) (y foo)) Compiling the WORKING definition works perfectly, while compiling BROKEN produces the following error in SBCL: ; caught ERROR: ; don't know how to dump #<CFFI::AGGREGATE-STRUCT-SLOT {10041256D1}> (default MAKE-LOAD-FORM method called). This appears to stem from the application of the following compiler macro (and ultimately the result of foreign-struct-slot-set-form) to the generated accessors: (define-compiler-macro foreign-slot-set (&whole form value ptr type slot-name) "Optimizer when TYPE and SLOT-NAME are constant." (if (and (constantp type) (constantp slot-name)) (foreign-struct-slot-set-form value ptr (get-slot-info (eval type) (eval slot-name))) form)) This occurs for arrays as well as structures for the slot type, but not simpler types (:int, etc).
On Sun, May 24, 2009 at 7:03 AM, Andy Hefner <ahefner@gmail.com> wrote:
(defcstruct (broken :conc-name broken-) (y foo))
Compiling the WORKING definition works perfectly, while compiling BROKEN produces the following error in SBCL:
Thanks for the report. I've pushed a fix to the repository. -- Luís Oliveira http://student.dei.uc.pt/~lmoliv/
participants (2)
-
Andy Hefner
-
Luís Oliveira