Skip to content

Commit 817549c

Browse files
committed
bugfix: read crash
Parsing some READ sentences with semantic errors crashed the compiler. Fixed.
1 parent 03156e9 commit 817549c

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

tests/functional/read11.bas

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1 BORDER 0: PAPER 0: INK 9: BRIGHT 1: CLS
2+
10 LET spheres=2: IF spheres THEN DIM c(spheres,3): DIM r(spheres): DIM q(spheres)
3+
20 FOR k=1 TO spheres: READ c(k,1),c(k,2),c(k,3),r: LET r(k)=r: LET q(k)=r*r: NEXT k
4+

zxbparser.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,6 +1635,9 @@ def p_read(p):
16351635
gl.DATA_IS_USED = True
16361636
reads = []
16371637

1638+
if p[2] is None:
1639+
return
1640+
16381641
for arg in p[2]:
16391642
entry = arg.value
16401643
if entry is None:

0 commit comments

Comments
 (0)