mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-02-11 07:30:24 +00:00
When an operand is missing, synthesize a "0" operand for post-error processing.
This ensures consistent behavior and avoids null-pointer dereferences in some cases.
This commit is contained in:
parent
b0b2b3fa91
commit
13a14d9389
@ -874,12 +874,17 @@ var
|
||||
if stack = nil then begin
|
||||
Error(36);
|
||||
errorFound := true;
|
||||
Pop := nil;
|
||||
end {if}
|
||||
else begin
|
||||
Pop := stack;
|
||||
stack := stack^.next;
|
||||
end; {else}
|
||||
new(stack); {synthesize the missing token}
|
||||
stack^.token.class := intConstant;
|
||||
stack^.token.kind := intconst;
|
||||
stack^.token.ival := 0;
|
||||
stack^.next := nil;
|
||||
stack^.left := nil;
|
||||
stack^.middle := nil;
|
||||
stack^.right := nil;
|
||||
end; {if}
|
||||
Pop := stack;
|
||||
stack := stack^.next;
|
||||
end; {Pop}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user