From 58f2ebddecd12cbdeb8d0ca8fa5b8ddbc4e35f28 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Fri, 19 Feb 2021 23:46:57 -0600 Subject: [PATCH] Allow static evaluation of ? : expressions with long long operands. --- Expression.pas | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Expression.pas b/Expression.pas index 12ea149..37d10b4 100644 --- a/Expression.pas +++ b/Expression.pas @@ -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;