From 4d7aa9e2eaf3b1ec17fad81121f4ea51ea06f077 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 26 Nov 2009 17:24:13 +0000 Subject: [PATCH] codetools: expreval: and, or short eval set 0,1 git-svn-id: trunk@22799 - --- components/codetools/expreval.pas | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/codetools/expreval.pas b/components/codetools/expreval.pas index 0338dc1fd0..1ab9cbb618 100644 --- a/components/codetools/expreval.pas +++ b/components/codetools/expreval.pas @@ -1606,7 +1606,10 @@ begin 'A': if CompareIdentifiers(AtomStart,'AND')=0 then begin OperatorLvl:=1; - if not OperandIsTrue(Operand) then break; + if not OperandIsTrue(Operand) then begin + SetOperandValueChar(Operand,'0'); + break; + end; end; 'D': if CompareIdentifiers(AtomStart,'DIV')=0 then OperatorLvl:=1; 'M': if CompareIdentifiers(AtomStart,'MOD')=0 then OperatorLvl:=1; @@ -1623,7 +1626,10 @@ begin 'R': if p-AtomStart=2 then begin OperatorLvl:=2; - if OperandIsTrue(Operand) then break; + if OperandIsTrue(Operand) then begin + SetOperandValueChar(Operand,'1'); + break; + end; end; end; 'X': if CompareIdentifiers(AtomStart,'XOR')=0 then OperatorLvl:=2;