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
Fix crash on pointer dereference after declaration
The parser would crash with "Unexpected token" when a pointer
dereference assignment (e.g., '*p = 0') appeared immediately after a
pointer declaration in the same block. This is a common C pattern that
was blocking normal code compilation.
The issue occurred because the parser tried to interpret '*p' as a type
declaration when it appeared after a pointer declaration like
"int *p = &x;". The ambiguity between * as a type modifier versus a
dereference operator caused the crash.
This fix adds lookahead logic to check if the identifier after '*' is a
known type. Only if it is a type will the statement be treated as a
declaration; otherwise it's handled as a pointer dereference.
0 commit comments