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 | 42e9af8981e3c82407d08754cdf89260b90ee4fb (patch) | |
tree | d1d9808642ba8b90643a783e566fc3e66c92cf26 | |
parent | 860d69fc371cdddce1b4db1409201ecd67c88be6 (diff) | |
download | txr-42e9af8981e3c82407d08754cdf89260b90ee4fb.tar.gz txr-42e9af8981e3c82407d08754cdf89260b90ee4fb.tar.bz2 txr-42e9af8981e3c82407d08754cdf89260b90ee4fb.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.
-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)); |