Skip to content

Commit 4fc1d42

Browse files
authored
Merge pull request #231 from boriel/bugfix/parser_crash_on_wron_callable_args
Fix parser crash on wrong callable args
2 parents 6623a1c + 06e67a7 commit 4fc1d42

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tests/functional/callable_err.bas

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
IF m$(s(1)-vm,s(2)-hm)="\c" THEN REM
2+
3+

zxbparser.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2593,6 +2593,10 @@ def p_expr_funccall(p):
25932593
def p_idcall_expr(p):
25942594
""" func_call : ID arg_list %prec UMINUS
25952595
""" # This can be a function call or a string index
2596+
if p[2] is None:
2597+
p[0] = None
2598+
return
2599+
25962600
p[0] = make_call(p[1], p.lineno(1), p[2])
25972601
if p[0] is None:
25982602
return

0 commit comments

Comments
 (0)