Allow static evaluation of ? : expressions with long long operands.

This commit is contained in:
Stephen Heumann 2021-02-19 23:46:57 -06:00
parent 75c7cd95d3
commit 58f2ebddec

View File

@ -1101,13 +1101,14 @@ var
op^.right := Pop;
op^.middle := Pop;
op^.left := Pop;
if op^.right^.token.kind in
[intconst,uintconst,longconst,ulongconst] then
if op^.left^.token.kind in
[intconst,uintconst,longconst,ulongconst] then
if op^.middle^.token.kind in
[intconst,uintconst,longconst,ulongconst] then begin
if IntVal(op^.left^.token) <> 0 then
if op^.right^.token.kind in [intconst,uintconst,
longconst,ulongconst,longlongconst,ulonglongconst] then
if op^.left^.token.kind in [intconst,uintconst,
longconst,ulongconst,longlongconst,ulonglongconst] then
if op^.middle^.token.kind in [intconst,uintconst,
longconst,ulongconst,longlongconst,ulonglongconst] then begin
GetLongLongVal(llop1, op^.left^.token);
if (llop1.lo <> 0) or (llop1.hi <> 0) then
op^.token := op^.middle^.token
else
op^.token := op^.right^.token;