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
commit725338a17056b5a71ad8f3bb687fb899206a0c31 (patch)
tree1cf356115899d0ebfacfe20270bc470665c3de7d
parentc2fd426c4b57d61911e3c3c89a99eb17a90a5ba8 (diff)
downloadtxr-725338a17056b5a71ad8f3bb687fb899206a0c31.tar.gz
txr-725338a17056b5a71ad8f3bb687fb899206a0c31.tar.bz2
txr-725338a17056b5a71ad8f3bb687fb899206a0c31.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);
+ }
}
}