shithub: MicroHs

Download patch

ref: 7e4beb4cdf325d0691ccd079ab452fd4b532adf1
parent: 3b96876c8a21fd5b1df994d56a4470bd623d0db2
parent: e9db912ad8b6d21681c20c78d77c98cf6d19e0be
author: Lennart Augustsson <lennart@augustsson.net>
date: Fri Feb 2 06:03:43 EST 2024

Merge pull request #30 from jmaessen/no-parse-crash

GC check during parse so we don't crash.

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