From 7b429c10bb6f4fdbcda0aa146999839a39844c9b Mon Sep 17 00:00:00 2001 From: Lennart Augustsson Date: Wed, 1 Jan 2025 17:02:13 +0100 Subject: [PATCH] Better error message when running out of heap when reading the code. --- src/runtime/eval.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/runtime/eval.c b/src/runtime/eval.c index f5e6c572..b0f07cdc 100644 --- a/src/runtime/eval.c +++ b/src/runtime/eval.c @@ -1705,6 +1705,8 @@ parse(BFILE *f) case '\n': continue; } + if (num_free < 3) + ERR("out of heap reading code"); GCCHECK(1); switch(c) { case '@': @@ -3823,6 +3825,7 @@ execio(NODEPTR *np) case T_IO_DESERIALIZE: CHECKIO(1); ptr = (struct BFILE*)evalptr(ARG(TOP(1))); + gc(); /* make sure we have room. GC during parse is dodgy. */ n = parse_top(ptr); RETIO(n); #endif