summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-02-06 07:22:49 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-02-06 07:22:49 -0800
commit0a9221983c5229fb9a2159592ca92d753e19693e (patch)
tree1cf356115899d0ebfacfe20270bc470665c3de7d
parente86704accbf48510cd11734ff5a87c072a7035a6 (diff)
downloadtxr-0a9221983c5229fb9a2159592ca92d753e19693e.tar.gz
txr-0a9221983c5229fb9a2159592ca92d753e19693e.tar.bz2
txr-0a9221983c5229fb9a2159592ca92d753e19693e.zip
ffi: make-zstruct must ignore padding slots.
* ffi.c (make_zstruct): Don't convert zeros to a Lisp type and don't try to set the slot, if the slot name is nil. That's a padding slot which doesn't exist in the Lisp type; the slotset will blow up on it.
-rw-r--r--ffi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ffi.c b/ffi.c
index cbffce50..1cc004cc 100644
--- a/ffi.c
+++ b/ffi.c
@@ -5369,8 +5369,10 @@ val make_zstruct(val type, struct args *args)
if (!inited[i]) {
struct smemb *m = &tft->memb[i];
val slsym = m->mname;
- val initval = m->mtft->get(m->mtft, zbuf, self);
- slotset(strct, slsym, initval);
+ if (slsym) {
+ val initval = m->mtft->get(m->mtft, zbuf, self);
+ slotset(strct, slsym, initval);
+ }
}
}