From 7ef09a3af8246fdd17f27855a93803162562acf3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 2 Sep 2015 07:35:57 -0700 Subject: Fix broken finalization support. * gc.c (call_finals): Correct inverted test for reachability. The function was processing entries that are still reachable and calling their finalizers, and retaining unreachable entries in the finalization list. --- gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gc.c b/gc.c index d524c984..f17a4b47 100644 --- a/gc.c +++ b/gc.c @@ -639,7 +639,7 @@ static void call_finals(void) for (f = old_list; f; f = next) { next = f->next; - if ((f->obj_type & REACHABLE) != 0) { + if ((f->obj_type & REACHABLE) == 0) { funcall1(f->fun, f->obj); free(f); } else { -- cgit v1.2.3