From f63a8d430ec733b2e89f386fd05da991209153f1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 11 Apr 2021 12:28:18 -0700 Subject: gc: sys:gc function must not reset full_gc flag. * gc.c (gc_wrap): We must not set full_gc according to the argument, but only set it to 1 if the argument requests full GC. full_gc is set to 1 for some reason having to do with correctness; only the garbage collector can reset full_gc back to 0, otherwise incorrect behavior will ensue. --- gc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gc.c b/gc.c index f3ce3275..c2a4f657 100644 --- a/gc.c +++ b/gc.c @@ -974,7 +974,8 @@ static val gc_wrap(val full) { if (gc_enabled) { #if CONFIG_GEN_GC - full_gc = !null_or_missing_p(full); + if (!null_or_missing_p(full)) + full_gc = 1; #endif gc(); return t; -- cgit v1.2.3