Hexadecimal/octal constants 0x80000000+ should have type unsigned long.

They previously had type signed long (with negative values).
This commit is contained in:
Stephen Heumann 2021-02-02 18:26:31 -06:00
parent 393fb8d635
commit 8ac887f4dc

View File

@ -3337,7 +3337,7 @@ else if numString[1] <> '0' then begin {convert a decimal integer}
token.lval := Convertsl(numString); token.lval := Convertsl(numString);
end; {else} end; {else}
end {else if} end {else if}
else begin {hex & octal} else begin {hex, octal, & binary}
token.lval := 0; token.lval := 0;
if isHex then begin if isHex then begin
i := 3; i := 3;
@ -3392,7 +3392,7 @@ else begin {hex & octal}
if long(token.lval).msw <> 0 then if long(token.lval).msw <> 0 then
isLong := true; isLong := true;
if isLong then begin if isLong then begin
if unsigned then if unsigned or (token.lval & $80000000 <> 0) then
token.kind := ulongConst token.kind := ulongConst
else else
token.kind := longConst; token.kind := longConst;