Jelajahi Sumber

* fixed getcopy order for ttempcreatenode in case it has tempinitcode
(this tempinitcode contains a reference to the tempcreatenode itself
-> hookoncopy must be set before copying the tempinitnode)

git-svn-id: trunk@18016 -

Jonas Maebe 14 tahun lalu
induk
melakukan
cb1da8de85
1 mengubah file dengan 10 tambahan dan 10 penghapusan
  1. 10 10
      compiler/nbas.pas

+ 10 - 10
compiler/nbas.pas

@@ -747,27 +747,27 @@ implementation
         n.tempinfo^.typedef := tempinfo^.typedef;
         n.tempinfo^.temptype := tempinfo^.temptype;
         n.tempinfo^.flags := tempinfo^.flags * tempinfostoreflags;
-        if assigned(tempinfo^.withnode) then
-          n.tempinfo^.withnode := tempinfo^.withnode.getcopy
-        else
-          n.tempinfo^.withnode := nil;
-
-        if assigned(tempinfo^.tempinitcode) then
-          n.tempinfo^.tempinitcode := tempinfo^.tempinitcode.getcopy
-        else
-          n.tempinfo^.tempinitcode := nil;
 
         { when the tempinfo has already a hookoncopy then it is not
           reset by a tempdeletenode }
         if assigned(tempinfo^.hookoncopy) then
           internalerror(200211262);
-
         { signal the temprefs that the temp they point to has been copied, }
         { so that if the refs get copied as well, they can hook themselves }
         { to the copy of the temp                                          }
         tempinfo^.hookoncopy := n.tempinfo;
         exclude(tempinfo^.flags,ti_nextref_set_hookoncopy_nil);
 
+        if assigned(tempinfo^.withnode) then
+          n.tempinfo^.withnode := tempinfo^.withnode.getcopy
+        else
+          n.tempinfo^.withnode := nil;
+
+        if assigned(tempinfo^.tempinitcode) then
+          n.tempinfo^.tempinitcode := tempinfo^.tempinitcode.getcopy
+        else
+          n.tempinfo^.tempinitcode := nil;
+
         result := n;
       end;