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

* fixed copying order of callnode siblings (callcleanupblock must be
copied before funcretnode because it may contain tempdeletenodes
that turn a temp to "delete on next use", with the use in the
funcretnode)

git-svn-id: branches/jvmbackend@20141 -

Jonas Maebe 13 жил өмнө
parent
commit
7f15423d76
1 өөрчлөгдсөн 8 нэмэгдсэн , 4 устгасан
  1. 8 4
      compiler/ncal.pas

+ 8 - 4
compiler/ncal.pas

@@ -1334,14 +1334,18 @@ implementation
           n.methodpointer:=methodpointer.dogetcopy
         else
           n.methodpointer:=nil;
-        if assigned(funcretnode) then
-          n.funcretnode:=funcretnode.dogetcopy
-        else
-          n.funcretnode:=nil;
+        { must be copied before the funcretnode, because the callcleanup block
+          may contain a ttempdeletenode that sets the tempinfo of the
+          corresponding temp to ti_nextref_set_hookoncopy_nil, and this nextref
+          itself may be the funcretnode }
         if assigned(callcleanupblock) then
           n.callcleanupblock:=tblocknode(callcleanupblock.dogetcopy)
         else
           n.callcleanupblock:=nil;
+        if assigned(funcretnode) then
+          n.funcretnode:=funcretnode.dogetcopy
+        else
+          n.funcretnode:=nil;
         if assigned(varargsparas) then
          begin
            n.varargsparas:=tvarargsparalist.create(true);