浏览代码

* don't generate tempsfinalize nodes in except filter procdefs, as that would
finalize the parent's temps twice (fix for r40345, mantis #34574)

git-svn-id: trunk@40357 -

Jonas Maebe 6 年之前
父节点
当前提交
b96a8aee61
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      compiler/psub.pas

+ 6 - 3
compiler/psub.pas

@@ -765,7 +765,8 @@ implementation
                   (cs_implicit_exceptions in current_settings.moduleswitches)) then
                   begin
                     include(tocode.flags,nf_block_with_exit);
-                    addstatement(newstatement,cfinalizetempsnode.create);
+                    if procdef.proctypeoption<>potype_exceptfilter then
+                      addstatement(newstatement,cfinalizetempsnode.create);
                     cnodeutils.procdef_block_add_implicit_finalize_nodes(procdef,newstatement);
                     temps_finalized:=true;
                   end;
@@ -910,7 +911,8 @@ implementation
             current_filepos:=exitpos;
             { Generate code that will be in the try...finally }
             finalcode:=internalstatements(codestatement);
-            addstatement(codestatement,cfinalizetempsnode.create);
+            if procdef.proctypeoption<>potype_exceptfilter then
+              addstatement(codestatement,cfinalizetempsnode.create);
             cnodeutils.procdef_block_add_implicit_finalize_nodes(procdef,codestatement);
             temps_finalized:=true;
 
@@ -943,7 +945,8 @@ implementation
             addstatement(newstatement,bodyexitcode);
             if not is_constructor then
               begin
-                addstatement(newstatement,cfinalizetempsnode.create);
+                if procdef.proctypeoption<>potype_exceptfilter then
+                  addstatement(newstatement,cfinalizetempsnode.create);
                 cnodeutils.procdef_block_add_implicit_finalize_nodes(procdef,newstatement);
                 temps_finalized:=true;
               end;