Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions symbols/bound.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,15 @@ def make_node(lower, upper, lineno):

if isinstance(lower, SymbolVAR):
lower = lower.value
if lower is None: # semantic error
syntax_error(lineno, "Unknown lower bound for array dimension")
return

if isinstance(upper, SymbolVAR):
upper = upper.value
if upper is None: # semantic error
syntax_error(lineno, "Unknown upper bound for array dimension")
return

lower.value = int(lower.value)
upper.value = int(upper.value)
Expand Down
4 changes: 4 additions & 0 deletions tests/functional/dim_const_crash.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

const MAXMOBS as ubyte = MHEIGHT
dim mobCoords(0 to MAXMOBS, 0 to 1) as ubyte