The reason is that we store line/offset pairs in a map, if a line-number doesn't appear then we return 0.
In short:
10 GOSUB 1000
Becomes:
GOTO [offset] 0
So line 20 never gets hit.
Found via fuzzing:
frodo ~/go/src/github.com/skx/gobasic $ cat workdir/crashers/e94d89a546f0bd779180c5a8dc969e6d4fd8a227
10 REM This program tests that GOSUB+RETURN works
20 GOSUB 10030
40 GOSUB 100
50 END
100 PRINT "SUBROUTINE WAS CALLED!\n"
110 RETURN
This program is an infinite loop:
The reason is that we store line/offset pairs in a map, if a line-number doesn't appear then we return 0.
In short:
Becomes:
So line 20 never gets hit.
Found via fuzzing: