summaryrefslogtreecommitdiff
path: root/compiler/ncgutil.pas
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-05-19 20:34:41 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-05-19 20:34:41 +0000
commit49312baab1ec7b8ed63f0d172e4adabf542a0111 (patch)
treed022da0006816600a5e5ccdcabe57af7801b18a3 /compiler/ncgutil.pas
parentf36702ea92ecb0349d4a1675fc7e45ca86c1d785 (diff)
downloadfpc-49312baab1ec7b8ed63f0d172e4adabf542a0111.tar.gz
* exceptions are side effects which must be considered in boolean expressions
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@45441 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/ncgutil.pas')
-rw-r--r--compiler/ncgutil.pas5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas
index 85f0eb4b96..e0eafd8af7 100644
--- a/compiler/ncgutil.pas
+++ b/compiler/ncgutil.pas
@@ -107,7 +107,7 @@ implementation
defutil,
procinfo,paramgr,
dbgbase,
- nbas,ncon,nld,nmem,nutils,
+ nadd,nbas,ncon,nld,nmem,nutils,
tgobj,cgobj,hlcgobj,hlcgcpu
{$ifdef powerpc}
, cpupi
@@ -192,7 +192,8 @@ implementation
{ always calculate boolean AND and OR from left to right }
if (p.nodetype in [orn,andn]) and
is_boolean(p.left.resultdef) and
- (might_have_sideeffects(p.left) or might_have_sideeffects(p.right)) then
+ (might_have_sideeffects(p.left,[mhs_exceptions]) or might_have_sideeffects(p.right,[mhs_exceptions]) or
+ (nf_short_bool in taddnode(p).flags)) then
begin
if nf_swapped in p.flags then
internalerror(200709253);