mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-22 23:29:27 +00:00
Set expressionType to a default value when LoadAddress encounters an error.
This can occur in cases such as trying to assign to a non-l-value. This patch ensures consistent handling of errors and prevents null pointer dereferences.
This commit is contained in:
parent
91094e9292
commit
cb063afa47
@ -2405,9 +2405,11 @@ var
|
|||||||
|
|
||||||
else if ExpressionKind(tree) in [arrayType,pointerType] then
|
else if ExpressionKind(tree) in [arrayType,pointerType] then
|
||||||
GenerateCode(tree)
|
GenerateCode(tree)
|
||||||
else
|
else begin
|
||||||
|
expressionType := wordPtr; {set default type in case of error}
|
||||||
if doDispose then {prevent spurious errors}
|
if doDispose then {prevent spurious errors}
|
||||||
Error(78);
|
Error(78);
|
||||||
|
end; {else}
|
||||||
1:
|
1:
|
||||||
end; {LoadAddress}
|
end; {LoadAddress}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user