Skip to content

Commit

Permalink
Better error message when running out of heap when reading the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
augustss committed Jan 1, 2025
1 parent f88a408 commit 7b429c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/runtime/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 '@':
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7b429c1

Please sign in to comment.