shithub: MicroHs

Download patch

ref: e9db912ad8b6d21681c20c78d77c98cf6d19e0be
parent: 3a4d34e2b341cea476d069c653265e50c295a9e5
author: Jan-Willem Maessen <jmaessen@fb.com>
date: Sun Jan 28 10:19:50 EST 2024

GC check during parse so we don't crash.

--- a/src/runtime/eval.c
+++ b/src/runtime/eval.c
@@ -737,7 +737,7 @@
 
 //counter_t mark_depth;
 
-/* Mark all used nodes reachable from *np */
+/* Mark all used nodes reachable from *np, updating *np. */
 void
 mark(NODEPTR *np)
 {
@@ -1256,7 +1256,10 @@
     switch (c) {
     case ' ':
     case '\n':
-      break;
+      continue;
+    }
+    GCCHECK(1);
+    switch(c) {
     case '@':
       x = TOP(0);
       y = TOP(1);
--