mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 07:49:12 +02:00
parent
be371d901c
commit
c2c7c23f21
@ -324,8 +324,8 @@ procedure tx64tryfinallynode.pass_generate_code;
|
||||
{ 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);
|
||||
if ((flowcontrol*[fc_exit,fc_break,fc_continue])<>[]) and (fc_inflowcontrol in oldflowcontrol) then
|
||||
oldflowcontrol:=oldflowcontrol+(flowcontrol*[fc_exit,fc_break,fc_continue]);
|
||||
|
||||
flowcontrol:=[fc_inflowcontrol];
|
||||
{ generate finally code as a separate procedure }
|
||||
@ -440,8 +440,8 @@ procedure tx64tryexceptnode.pass_generate_code;
|
||||
{ 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);
|
||||
if ((flowcontrol*[fc_exit,fc_break,fc_continue])<>[]) and (fc_inflowcontrol in oldflowcontrol) then
|
||||
oldflowcontrol:=oldflowcontrol+(flowcontrol*[fc_exit,fc_break,fc_continue]);
|
||||
|
||||
flowcontrol:=[fc_inflowcontrol];
|
||||
{ on statements }
|
||||
@ -536,8 +536,8 @@ errorexit:
|
||||
{ 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);
|
||||
if ((flowcontrol*[fc_exit,fc_break,fc_continue])<>[]) and (fc_inflowcontrol in oldflowcontrol) then
|
||||
oldflowcontrol:=oldflowcontrol+(flowcontrol*[fc_exit,fc_break,fc_continue]);
|
||||
|
||||
{ restore the control flow labels }
|
||||
current_procinfo.CurrExitLabel:=oldCurrExitLabel;
|
||||
|
@ -1,9 +1,9 @@
|
||||
{ %norun }
|
||||
{$mode objfpc}
|
||||
procedure p;
|
||||
procedure p1;
|
||||
begin
|
||||
try
|
||||
writeln
|
||||
writeln;
|
||||
except
|
||||
try
|
||||
writeln;
|
||||
@ -14,5 +14,41 @@ procedure p;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure p2;
|
||||
var
|
||||
i : longint;
|
||||
begin
|
||||
for i:=1 to 10 do
|
||||
try
|
||||
writeln;
|
||||
except
|
||||
try
|
||||
writeln;
|
||||
break;
|
||||
finally
|
||||
writeln;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure p3;
|
||||
var
|
||||
i : longint;
|
||||
begin
|
||||
for i:=1 to 10 do
|
||||
try
|
||||
writeln;
|
||||
except
|
||||
try
|
||||
writeln;
|
||||
continue;
|
||||
finally
|
||||
writeln;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user