From fcf2cd2bea510174b60d78d534d331aa2477b5f9 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 17 May 2020 17:41:43 +0000 Subject: [PATCH] * boolean or/and nodes might be swapped when they have no side effect, in case of short boolean evaluation, firstcomplex is not called so this does not hurt short boolean evaluation git-svn-id: trunk@45403 - --- compiler/ncgutil.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index ac544bf1b2..b4d0063c24 100644 --- a/compiler/ncgutil.pas +++ b/compiler/ncgutil.pas @@ -191,7 +191,8 @@ implementation begin { always calculate boolean AND and OR from left to right } if (p.nodetype in [orn,andn]) and - is_boolean(p.left.resultdef) then + is_boolean(p.left.resultdef) and + (might_have_sideeffects(p.left) or might_have_sideeffects(p.right)) then begin if nf_swapped in p.flags then internalerror(200709253);