summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-11 12:28:18 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-11 12:28:18 -0700
commitf63a8d430ec733b2e89f386fd05da991209153f1 (patch)
tree556a1c8574cb7d0bb86a42a0478a54aaad3c49f5
parentfc77185673b16e13a24dec369c43c9dd82997bd9 (diff)
downloadtxr-f63a8d430ec733b2e89f386fd05da991209153f1.tar.gz
txr-f63a8d430ec733b2e89f386fd05da991209153f1.tar.bz2
txr-f63a8d430ec733b2e89f386fd05da991209153f1.zip
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.
-rw-r--r--gc.c3
1 files changed, 2 insertions, 1 deletions
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;