Browse Source

* simple record accesses have not side effects

git-svn-id: trunk@44269 -
florian 5 years ago
parent
commit
424c8a0ac0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compiler/nutils.pas

+ 2 - 1
compiler/nutils.pas

@@ -1401,7 +1401,8 @@ implementation
             tinlinenode(n).may_have_sideeffect_norecurse
             tinlinenode(n).may_have_sideeffect_norecurse
            ) or
            ) or
            ((mhs_exceptions in pmhs_flags(arg)^) and
            ((mhs_exceptions in pmhs_flags(arg)^) and
-            ((n.nodetype in [derefn,vecn,subscriptn]) or
+            ((n.nodetype in [derefn,vecn]) or
+             ((n.nodetype=subscriptn) and is_implicit_pointer_object_type(tsubscriptnode(n).left.resultdef)) or
              ((n.nodetype in [addn,subn,muln,divn,slashn,unaryminusn]) and (n.localswitches*[cs_check_overflow,cs_check_range]<>[]))
              ((n.nodetype in [addn,subn,muln,divn,slashn,unaryminusn]) and (n.localswitches*[cs_check_overflow,cs_check_range]<>[]))
             )
             )
            ) or
            ) or