Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request boriel-basic#623 from boriel/fix/crash_on_explicit
Browse files Browse the repository at this point in the history
fix: crash on using explicit
  • Loading branch information
boriel committed Oct 12, 2022
2 parents 9dcd082 + ea35a4e commit 25da966
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/symboltable/symboltable.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def access_id(
ignore_explicit_flag=False,
):
"""Access a symbol by its identifier and checks if it exists.
If not, it's supposed to be an implicit declared variable.
If not, it's supposed to be an implicitly declared variable.
default_class is the class to use in case of an undeclared-implicit-accessed id
"""
Expand Down
3 changes: 3 additions & 0 deletions src/zxbc/zxbparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ def make_call(id_: str, lineno: int, args: symbols.ARGLIST):
This function will inspect the id_. If it is undeclared then
id_ will be taken as a forwarded function.
"""
if args is None:
return None

assert isinstance(args, symbols.ARGLIST)

entry = SYMBOL_TABLE.access_call(id_, lineno)
Expand Down
13 changes: 13 additions & 0 deletions tests/functional/zx48k/explicit_crash.bas
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
REM when compiling with --explicit this should
REM raise an error

#pragma explicit=true

DIM r(5, 5) As Ubyte
DIM q as Ubyte

for x = 1 to 5
for y = 1 to 5
q = r(y, x)
next
next

0 comments on commit 25da966

Please sign in to comment.