From cb1da8de852152f910011e0e2ea1a074d1b57994 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Mon, 18 Jul 2011 00:38:47 +0000 Subject: [PATCH] * 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 - --- compiler/nbas.pas | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/compiler/nbas.pas b/compiler/nbas.pas index a6c48972b8..ba61e2df62 100644 --- a/compiler/nbas.pas +++ b/compiler/nbas.pas @@ -747,6 +747,17 @@ implementation n.tempinfo^.typedef := tempinfo^.typedef; n.tempinfo^.temptype := tempinfo^.temptype; n.tempinfo^.flags := tempinfo^.flags * tempinfostoreflags; + + { 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 @@ -757,17 +768,6 @@ implementation 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); - result := n; end;