mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-22 23:29:27 +00:00
Fix bug where certain integer constant expressions would have type signed long when they should have type unsigned long.
This affected binary or unary expressions with constant operands, at least one of which was of type unsigned long. The following test case demonstrates the problem: #include <stdio.h> int main (void) { if (0 + 0x80000000ul < 0) puts("error 1"); if (~0ul < 0) puts("error 2"); }
This commit is contained in:
parent
b8c1ea753f
commit
26a800e667
@ -910,11 +910,9 @@ var
|
|||||||
end {else if}
|
end {else if}
|
||||||
else if token.kind = longconst then begin
|
else if token.kind = longconst then begin
|
||||||
IntVal := token.lval;
|
IntVal := token.lval;
|
||||||
ekind := longconst;
|
|
||||||
end {else if}
|
end {else if}
|
||||||
else begin
|
else begin
|
||||||
IntVal := token.lval;
|
IntVal := token.lval;
|
||||||
ekind := longconst;
|
|
||||||
unsigned := true;
|
unsigned := true;
|
||||||
end; {else}
|
end; {else}
|
||||||
end; {IntVal}
|
end; {IntVal}
|
||||||
|
Loading…
Reference in New Issue
Block a user