summaryrefslogtreecommitdiff
path: root/compiler/x86_64
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/x86_64')
-rw-r--r--compiler/x86_64/nx64flw.pas18
1 files changed, 18 insertions, 0 deletions
diff --git a/compiler/x86_64/nx64flw.pas b/compiler/x86_64/nx64flw.pas
index b205bf8987..20ac25cf57 100644
--- a/compiler/x86_64/nx64flw.pas
+++ b/compiler/x86_64/nx64flw.pas
@@ -321,6 +321,12 @@ procedure tx64tryfinallynode.pass_generate_code;
cg.a_label(current_asmdata.CurrAsmList,endtrylabel);
end;
+ { i32913 - if the try..finally block is also inside a try..finally or
+ try..except block, make a note of any Exit calls so all necessary labels
+ are generated. [Kit] }
+ if (fc_exit in flowcontrol) and (fc_inflowcontrol in oldflowcontrol) then
+ Include(oldflowcontrol, fc_exit);
+
flowcontrol:=[fc_inflowcontrol];
{ generate finally code as a separate procedure }
if not implicitframe then
@@ -431,6 +437,12 @@ procedure tx64tryexceptnode.pass_generate_code;
current_procinfo.CurrBreakLabel:=breakexceptlabel;
end;
+ { i32913 - if the try..finally block is also inside a try..finally or
+ try..except block, make a note of any Exit calls so all necessary labels
+ are generated. [Kit] }
+ if (fc_exit in flowcontrol) and (fc_inflowcontrol in oldflowcontrol) then
+ Include(oldflowcontrol, fc_exit);
+
flowcontrol:=[fc_inflowcontrol];
{ on statements }
if assigned(right) then
@@ -521,6 +533,12 @@ errorexit:
{ restore all saved labels }
endexceptlabel:=oldendexceptlabel;
+ { i32913 - if the try..finally block is also inside a try..finally or
+ try..except block, make a note of any Exit calls so all necessary labels
+ are generated. [Kit] }
+ if (fc_exit in flowcontrol) and (fc_inflowcontrol in oldflowcontrol) then
+ Include(oldflowcontrol, fc_exit);
+
{ restore the control flow labels }
current_procinfo.CurrExitLabel:=oldCurrExitLabel;
if assigned(oldBreakLabel) then