summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-05-11 08:00:50 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-05-11 08:00:50 -0700
commit643ba825b18caed84e08137ee92417a9f71b9024 (patch)
tree1c42e67cf2e414019f5f6d82111efa755194aa77
parenta084a3a21f6cfece7df00ed26a88795e250cd2f9 (diff)
downloadtxr-643ba825b18caed84e08137ee92417a9f71b9024.tar.gz
txr-643ba825b18caed84e08137ee92417a9f71b9024.tar.bz2
txr-643ba825b18caed84e08137ee92417a9f71b9024.zip
android: restore pointer tag in gc_free_all.
* gc.c (gc_free_all): Just like we do in the sweep function, we must mask back the pointer tag that we removed from the heap object's pointer, before handing the pointer to the free function. Starting in Android 11, the pointer tagging is more strict. It was not enforced previously; now our logic for stripping and restoring the tags is actualy being tested.
-rw-r--r--gc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 5fbf5c88..45106d8b 100644
--- a/gc.c
+++ b/gc.c
@@ -1279,7 +1279,11 @@ void gc_free_all(void)
finalize(block);
}
+#if CONFIG_NAN_BOXING_STRIP_TAG
+ free(coerce(heap_t *, coerce(ucnum, iter) | (iter->tag << TAG_BIGSHIFT)));
+#else
free(iter);
+#endif
iter = next;
}
}