浏览代码

* free the calleeside paraloc information after a unit has been compiled

git-svn-id: trunk@32519 -
Jonas Maebe 9 年之前
父节点
当前提交
ba92fdafcc
共有 2 个文件被更改,包括 32 次插入0 次删除
  1. 1 0
      compiler/pmodules.pas
  2. 31 0
      compiler/symdef.pas

+ 1 - 0
compiler/pmodules.pas

@@ -552,6 +552,7 @@ implementation
                     pd.localst:=nil;
                   end;
                 pd.freeimplprocdefinfo;
+                pd.done_paraloc_info(calleeside);
               end;
           end;
       end;

+ 31 - 0
compiler/symdef.pas

@@ -624,6 +624,7 @@ interface
           function  compatible_with_pointerdef_size(ptr: tpointerdef): boolean; virtual;
           procedure check_mark_as_nested;
           procedure init_paraloc_info(side: tcallercallee);
+          procedure done_paraloc_info(side: tcallercallee);
           function stack_tainting_parameter(side: tcallercallee): boolean;
           function is_pushleftright: boolean;virtual;
           function address_type:tdef;virtual;
@@ -5026,6 +5027,36 @@ implementation
       end;
 
 
+    procedure tabstractprocdef.done_paraloc_info(side: tcallercallee);
+      var
+        i: longint;
+      begin
+        if (side in [callerside,callbothsides]) and
+           (has_paraloc_info in [callerside,callbothsides]) then
+          begin
+            funcretloc[callerside].done;
+            for i:=0 to paras.count-1 do
+              tparavarsym(paras[i]).paraloc[callerside].done;
+            if has_paraloc_info=callerside then
+              has_paraloc_info:=callnoside
+            else
+              has_paraloc_info:=calleeside;
+          end;
+
+        if (side in [calleeside,callbothsides]) and
+           (has_paraloc_info in [calleeside,callbothsides]) then
+          begin
+            funcretloc[calleeside].done;
+            for i:=0 to paras.count-1 do
+              tparavarsym(paras[i]).paraloc[calleeside].done;
+            if has_paraloc_info=calleeside then
+              has_paraloc_info:=callnoside
+            else
+              has_paraloc_info:=callerside;
+          end;
+      end;
+
+
     function tabstractprocdef.stack_tainting_parameter(side: tcallercallee): boolean;
       var
         p: tparavarsym;