mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-20 00:29:50 +00:00
Fix bug where bitwise binary ops on 32-bit values will be miscalculated and trash the stack in certain cases.
The following program (derived from a csmith-generated test case) demonstrates the crash: #pragma optimize 8+64 #include <stdio.h> long g = 0; int main (void) { long l = 0x10305070; printf("%08lx\n", l ^ (g = (1 , 0x12345678))); }
This commit is contained in:
parent
c2b24f2854
commit
7605b7bbf2
5
Gen.pas
5
Gen.pas
@ -3895,7 +3895,10 @@ procedure GenTree {op: icptr};
|
||||
lab1: integer; {label number}
|
||||
|
||||
begin {GenOp}
|
||||
GenImplied(m_pla);
|
||||
if gLong.where = A_X then
|
||||
GenImplied(m_phx)
|
||||
else
|
||||
GenImplied(m_pla);
|
||||
if gLong.where = constant then begin
|
||||
GenNative(opi, immediate, long(gLong.lval).lsw, nil, 0);
|
||||
GenImplied(m_pha);
|
||||
|
Loading…
x
Reference in New Issue
Block a user