* 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 -
This commit is contained in:
Jonas Maebe 2018-11-20 19:25:06 +00:00
parent 74f950c88b
commit b96a8aee61

View File

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