mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-02-11 22:30:49 +00:00
Fix optimizer bug where tests of long or floating-point constants can trash the stack.
This problem could lead to crashes in code like the following (derived from a csmith-generated test case): #pragma optimize 1 int main (void) { if (1L) ; }
This commit is contained in:
parent
f2d15b8fc7
commit
21493271b9
2
DAG.pas
2
DAG.pas
@ -1327,6 +1327,7 @@ case op^.opcode of {check for optimizations of this node}
|
||||
op^.right := nil;
|
||||
end;
|
||||
end; {case}
|
||||
op^.optype := cgWord;
|
||||
end {if}
|
||||
else if op^.right^.optype in [cgByte, cgUByte, cgWord, cgUWord] then begin
|
||||
if op^.right^.q = 1 then
|
||||
@ -1755,6 +1756,7 @@ case op^.opcode of {check for optimizations of this node}
|
||||
op^.right := nil;
|
||||
end;
|
||||
end; {case}
|
||||
op^.optype := cgWord;
|
||||
end {if}
|
||||
else if op^.right^.optype in [cgByte, cgUByte, cgWord, cgUWord] then begin
|
||||
if op^.right^.q = 0 then
|
||||
|
Loading…
x
Reference in New Issue
Block a user