mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 13:29:29 +02:00
* 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 -
This commit is contained in:
parent
95ad75c7bf
commit
cb1da8de85
@ -747,6 +747,17 @@ implementation
|
|||||||
n.tempinfo^.typedef := tempinfo^.typedef;
|
n.tempinfo^.typedef := tempinfo^.typedef;
|
||||||
n.tempinfo^.temptype := tempinfo^.temptype;
|
n.tempinfo^.temptype := tempinfo^.temptype;
|
||||||
n.tempinfo^.flags := tempinfo^.flags * tempinfostoreflags;
|
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
|
if assigned(tempinfo^.withnode) then
|
||||||
n.tempinfo^.withnode := tempinfo^.withnode.getcopy
|
n.tempinfo^.withnode := tempinfo^.withnode.getcopy
|
||||||
else
|
else
|
||||||
@ -757,17 +768,6 @@ implementation
|
|||||||
else
|
else
|
||||||
n.tempinfo^.tempinitcode := nil;
|
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;
|
result := n;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user