From 643ba825b18caed84e08137ee92417a9f71b9024 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 11 May 2023 08:00:50 -0700 Subject: 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. --- gc.c | 4 ++++ 1 file changed, 4 insertions(+) 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; } } -- cgit v1.2.3