2
0
Эх сурвалжийг харах

+ might_have_sideeffects checks also if the tempinitcode of a tempref node might have side effects

git-svn-id: trunk@45656 -
florian 5 жил өмнө
parent
commit
8738b4b47f
1 өөрчлөгдсөн 7 нэмэгдсэн , 2 устгасан
  1. 7 2
      compiler/nutils.pas

+ 7 - 2
compiler/nutils.pas

@@ -1437,8 +1437,13 @@ implementation
                (vo_volatile in tabstractvarsym(tloadnode(n).symtableentry).varoptions)
              )
             )
-           ) then
-          result:=fen_norecurse_true;
+           ) or
+           { foreachonode does not recurse into the init code for temprefnode as this is done for
+             by the tempcreatenode but the considered tree might not contain the tempcreatenode so play
+             save and recurce into the init code if there is any }
+           ((n.nodetype=temprefn) and (ti_executeinitialisation in ttemprefnode(n).tempflags) and
+            might_have_sideeffects(ttemprefnode(n).tempinfo^.tempinitcode,pmhs_flags(arg)^)) then
+           result:=fen_norecurse_true
       end;