mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-02-11 22:30:49 +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
|
if stack = nil then begin
|
||||||
Error(36);
|
Error(36);
|
||||||
errorFound := true;
|
errorFound := true;
|
||||||
Pop := nil;
|
new(stack); {synthesize the missing token}
|
||||||
end {if}
|
stack^.token.class := intConstant;
|
||||||
else begin
|
stack^.token.kind := intconst;
|
||||||
|
stack^.token.ival := 0;
|
||||||
|
stack^.next := nil;
|
||||||
|
stack^.left := nil;
|
||||||
|
stack^.middle := nil;
|
||||||
|
stack^.right := nil;
|
||||||
|
end; {if}
|
||||||
Pop := stack;
|
Pop := stack;
|
||||||
stack := stack^.next;
|
stack := stack^.next;
|
||||||
end; {else}
|
|
||||||
end; {Pop}
|
end; {Pop}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user