You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parser: Fix/improve error recovery for procedure calls
This fixes a compiler crash during error recovery for BYREF AS ANY
parameters and (in theory) improves error recovery for procedure calls.
http://www.freebasic.net/forum/viewtopic.php?f=3&t=24140
The parser calls astNewCONSTz() to build some argument expression for
error recovery, but for ANY parameters, that returned NULL, causing
crashes later in astNewARG() which doesn't expect NULL.
Besides BYREF AS ANY parameters, it looks like astNewCONSTz() can only be
called with ANY type in case of SUBs (which internally use FB_DATATYPE_VOID
as type).
This patch changes the parser to build "proper" CALL expressions for error
recovery in the call parser, and it also changes astNewCONSTz() to never
return NULL anymore. If an ANY expression is requested, it just assumes
to be able to return an expression with any type.
This also means that cProcArgList() doesn't ever return NULL or a CONST
node anymore, but always a CALL node, which allows some further clean-ups.
Copy file name to clipboardExpand all lines: changelog.txt
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ Version 1.05.0
15
15
- #print typeof() output now differentiates between ZSTRING and ZSTRING * N (ZSTRING without size is produced by dereferencing a ZSTRING PTR, or BYREF AS ZSTRING)
16
16
- Context-specific keywords, e.g. graphics PUT modes, must now be given as keywords (e.g. PSET), string literals (e.g. "PSET") are no longer accepted.
17
17
- Wstring-to-Zstring conversions didn't use the system's Unicode <-> codepage conversion function, and only converted ASCII characters. Now it will try to convert the Unicode chars to codepage chars.
18
+
- Compiler crash during error recovery when there was an error when parsing the argument expression for a BYREF AS ANY parameter
0 commit comments