diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-05-25 19:09:56 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-05-25 19:09:56 -0700 |
commit | 761476fcb466b0dc8bfe35c71b873ebb7d2629a6 (patch) | |
tree | d1d9808642ba8b90643a783e566fc3e66c92cf26 /ffi.c | |
parent | fd402c48d244f7f823f18588bf67eda085b103e9 (diff) | |
download | txr-761476fcb466b0dc8bfe35c71b873ebb7d2629a6.tar.gz txr-761476fcb466b0dc8bfe35c71b873ebb7d2629a6.tar.bz2 txr-761476fcb466b0dc8bfe35c71b873ebb7d2629a6.zip |
ffi: bugfix: remove nil slots when making struct.
* ffi.c (ffi_type_compile): In the case when a struct type
is compiled and the Lisp struct doesn't exist, the function
creates the struct type. However, the FFI struct type syntax
allows nil as a slot name, indicating a padding field.
These nils must be scrubbed from the slot list when making
the Lisp struct type, or else an error occurs.
Diffstat (limited to 'ffi.c')
-rw-r--r-- | ffi.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1659,7 +1659,8 @@ val ffi_type_compile(val syntax) val sname = if3(name, name, gensym(lit("ffi-struct-"))); val slots = ffi_struct_compile(membs, &types, self); val stype = or2(if2(name, find_struct_type(sname)), - make_struct_type(sname, nil, nil, slots, + make_struct_type(sname, nil, nil, + remq(nil, slots, nil), nil, nil, nil, nil)); val xsyntax = cons(struct_s, cons(sname, membs)); |