浏览代码

* fixed memory leak with temp. variables, fixes #7282

git-svn-id: trunk@4998 -
florian 19 年之前
父节点
当前提交
dde9ad4755
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      compiler/ncgbas.pas

+ 3 - 0
compiler/ncgbas.pas

@@ -376,6 +376,9 @@ interface
           begin
             location_reset(tempinfo^.location,LOC_REFERENCE,def_cgsize(tempinfo^.restype.def));
             tg.GetTempTyped(current_asmdata.CurrAsmList,tempinfo^.restype.def,tempinfo^.temptype,tempinfo^.location.reference);
+            { the temp could have been used previously either because the memory location was reused or
+              because we're in a loop }
+            cg.g_finalize(current_asmdata.CurrAsmList,tempinfo^.restype.def,tempinfo^.location.reference);
           end
         else if tempinfo^.may_be_in_reg then
           begin