fix problem with traversing closures for GC

This bug is an old one, in a sense, because travesing fields
in a closure could have moved the prefix with earlier versions
of the collector. It shows up now because we're changing fields
one indirection closer.
This commit is contained in:
Matthew Flatt 2015-09-15 09:32:19 -06:00
parent 0781d0fa46
commit 68f8d63222

View File

@ -10,13 +10,16 @@
if (data) {
/* GLOBAL ASSUMPTION: prefix is at the end of a closure */
Scheme_Prefix *pf = (Scheme_Prefix *)c->vals[closure_size - 1];
if (pf) {
/* Since pf hasn't been marked, we don't need a GC_resolve(): */
int *use_bits = PREFIX_TO_USE_BITS(pf);
int *use_bits;
uintptr_t map;
int mark_stxes;
/* pf might have been marked via fields: */
pf = (Scheme_Prefix *)GC_resolve2(pf, gc);
use_bits = PREFIX_TO_USE_BITS(pf);
if (!pf->next_final) {
/* We're the first to look at this prefix... */
/* Add it to the chain of prefixes to finish after