diff options
author | B. Watson <urchlay@slackware.uk> | 2024-07-15 14:10:35 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-07-15 15:36:39 -0400 |
commit | c8a7eb85d06c71a184a7fe5aabd732d0779900cf (patch) | |
tree | a02270d0f3eee86199aff545a06ba516d91aba67 | |
parent | a13e921b196a2be691af256520877e4020a04f0c (diff) | |
download | bw-atari8-tools-c8a7eb85d06c71a184a7fe5aabd732d0779900cf.tar.gz |
bas.c: don't get stuck in an infinite loop if soffset == 0.
-rw-r--r-- | bas.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); |