diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-05-30 07:35:04 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-05-30 07:35:04 -0700 |
commit | f3225cb0e6bfaf17709b0c171e77cd58fb198ce1 (patch) | |
tree | 45fbaa61e8d6bb924cc85db2955f9dd707420370 | |
parent | ab99601555d48297af0897c022a8288283318100 (diff) | |
download | txr-f3225cb0e6bfaf17709b0c171e77cd58fb198ce1.tar.gz txr-f3225cb0e6bfaf17709b0c171e77cd58fb198ce1.tar.bz2 txr-f3225cb0e6bfaf17709b0c171e77cd58fb198ce1.zip |
tree: gc crash due to dummy object.
* tree.c (tr_rebuild): The dummy on-stack node we use in the rebuilding
process must have its generation field set to 1 rather than 0, so it looks
like a mature heap object rather than a baby object. Otherwise
when its pointer is assigned to another node which happens to
be gen 1, the on-stack dummy will be added to the checkobj array,
and gc will try to mark it.
-rw-r--r-- | tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -327,7 +327,7 @@ static void tr_rebuild(val tree, struct tree *tr, val node, val parent, ucnum size) { #if CONFIG_GEN_GC - obj_t dummy = { { TNOD, 0, 0, { 0 }, 0 } }; + obj_t dummy = { { TNOD, 0, 1, { 0 }, 0 } }; #else obj_t dummy = { { TNOD, { 0 }, 0 } }; #endif |