diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-03-22 23:09:55 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-03-22 23:09:55 -0700 |
commit | df0ade89277738dea89abfaa226e91a30025bf60 (patch) | |
tree | c02afd41c94502486a091542874abfcb9d4294ca /stdlib | |
parent | d30606a16dc974271d2d68303077b17ccaad67c7 (diff) | |
download | txr-df0ade89277738dea89abfaa226e91a30025bf60.tar.gz txr-df0ade89277738dea89abfaa226e91a30025bf60.tar.bz2 txr-df0ade89277738dea89abfaa226e91a30025bf60.zip |
ffi: gc bugfix in ffi_type_struct.
I haven't reproduced a crash with this and --gc-debug
doesn't do it, possibly due to the use of setcheck
in the loop. But make_ffi_type_struct is doing something
wrong: it's creating new compiled type objects in a loop
and sticking them into the memb array, which is not
visible to the garbage collector.
* ffi.c (make_ffi_type_struct): We move the initialization
of ffi->memb to above the loop, so that the object points
to the array. The loop is already setting ft->nelem to
the correct value i + 1 on each iteration of the loop,
thereby revealing each newly populated entry to the garbage
collector.
Diffstat (limited to 'stdlib')
0 files changed, 0 insertions, 0 deletions