aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bas.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bas.c b/bas.c
index 6be34f7..ddc424f 100644
--- a/bas.c
+++ b/bas.c
@@ -343,6 +343,10 @@ void walk_code(unsigned int startlineno, unsigned int endlineno) {
pos = linepos + 3;
while(pos < nextpos) { /* loop over statements within a line */
soffset = program[pos];
+ if(!soffset) {
+ fprintf(stderr, "Fatal: next-statement offset is 0 at line %d, pos %04x\n", lineno, pos);
+ exit(1);
+ }
end = linepos + soffset;
CALL(on_start_stmt);