Skip to content

Commit 36a5d98

Browse files
authored
Merge pull request #326 from boriel/bugfix/crash_dim_const
Fix crash on unknown constant dimension
2 parents fe5b3b2 + f7d7eeb commit 36a5d98

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

symbols/bound.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,15 @@ def make_node(lower, upper, lineno):
5050

5151
if isinstance(lower, SymbolVAR):
5252
lower = lower.value
53+
if lower is None: # semantic error
54+
syntax_error(lineno, "Unknown lower bound for array dimension")
55+
return
56+
5357
if isinstance(upper, SymbolVAR):
5458
upper = upper.value
59+
if upper is None: # semantic error
60+
syntax_error(lineno, "Unknown upper bound for array dimension")
61+
return
5562

5663
lower.value = int(lower.value)
5764
upper.value = int(upper.value)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
const MAXMOBS as ubyte = MHEIGHT
3+
dim mobCoords(0 to MAXMOBS, 0 to 1) as ubyte
4+

0 commit comments

Comments
 (0)