mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-09 15:26:29 +02:00
* nested try blocks work again
This commit is contained in:
parent
9de2afcbac
commit
68c2c36d36
@ -605,18 +605,20 @@ do_jmp:
|
|||||||
{ we modify EAX }
|
{ we modify EAX }
|
||||||
usedinproc:=usedinproc or ($80 shr byte(R_EAX));
|
usedinproc:=usedinproc or ($80 shr byte(R_EAX));
|
||||||
|
|
||||||
oldaktcontinuelabel:=aktcontinuelabel;
|
|
||||||
oldaktbreaklabel:=aktbreaklabel;
|
|
||||||
oldaktexitlabel:=aktexitlabel;
|
oldaktexitlabel:=aktexitlabel;
|
||||||
oldaktexit2label:=aktexit2label;
|
oldaktexit2label:=aktexit2label;
|
||||||
getlabel(exitexceptlabel);
|
getlabel(exitexceptlabel);
|
||||||
getlabel(breakexceptlabel);
|
|
||||||
getlabel(continueexceptlabel);
|
|
||||||
aktcontinuelabel:=continueexceptlabel;
|
|
||||||
aktbreaklabel:=breakexceptlabel;
|
|
||||||
aktexitlabel:=exitexceptlabel;
|
aktexitlabel:=exitexceptlabel;
|
||||||
aktexit2label:=exitexceptlabel;
|
aktexit2label:=exitexceptlabel;
|
||||||
|
if assigned(aktbreaklabel) then
|
||||||
|
begin
|
||||||
|
oldaktcontinuelabel:=aktcontinuelabel;
|
||||||
|
oldaktbreaklabel:=aktbreaklabel;
|
||||||
|
getlabel(breakexceptlabel);
|
||||||
|
getlabel(continueexceptlabel);
|
||||||
|
aktcontinuelabel:=continueexceptlabel;
|
||||||
|
aktbreaklabel:=breakexceptlabel;
|
||||||
|
end;
|
||||||
getlabel(exceptlabel);
|
getlabel(exceptlabel);
|
||||||
getlabel(doexceptlabel);
|
getlabel(doexceptlabel);
|
||||||
getlabel(endexceptlabel);
|
getlabel(endexceptlabel);
|
||||||
@ -681,16 +683,12 @@ do_jmp:
|
|||||||
emit_reg(A_POP,S_L,R_EAX);
|
emit_reg(A_POP,S_L,R_EAX);
|
||||||
emitjmp(C_None,oldaktexitlabel);
|
emitjmp(C_None,oldaktexitlabel);
|
||||||
|
|
||||||
if assigned(oldaktbreaklabel) then
|
if assigned(aktbreaklabel) then
|
||||||
begin
|
begin
|
||||||
emitlab(breakexceptlabel);
|
emitlab(breakexceptlabel);
|
||||||
emitcall('FPC_POPADDRSTACK');
|
emitcall('FPC_POPADDRSTACK');
|
||||||
emit_reg(A_POP,S_L,R_EAX);
|
emit_reg(A_POP,S_L,R_EAX);
|
||||||
emitjmp(C_None,oldaktbreaklabel);
|
emitjmp(C_None,oldaktbreaklabel);
|
||||||
end;
|
|
||||||
|
|
||||||
if assigned(oldaktcontinuelabel) then
|
|
||||||
begin
|
|
||||||
emitlab(continueexceptlabel);
|
emitlab(continueexceptlabel);
|
||||||
emitcall('FPC_POPADDRSTACK');
|
emitcall('FPC_POPADDRSTACK');
|
||||||
emit_reg(A_POP,S_L,R_EAX);
|
emit_reg(A_POP,S_L,R_EAX);
|
||||||
@ -699,11 +697,14 @@ do_jmp:
|
|||||||
|
|
||||||
emitlab(endexceptlabel);
|
emitlab(endexceptlabel);
|
||||||
|
|
||||||
|
endexceptlabel:=oldendexceptlabel;
|
||||||
aktexitlabel:=oldaktexitlabel;
|
aktexitlabel:=oldaktexitlabel;
|
||||||
aktexit2label:=oldaktexit2label;
|
aktexit2label:=oldaktexit2label;
|
||||||
aktcontinuelabel:=oldaktcontinuelabel;
|
if assigned(aktbreaklabel) then
|
||||||
aktbreaklabel:=oldaktbreaklabel;
|
begin
|
||||||
endexceptlabel:=oldendexceptlabel;
|
aktcontinuelabel:=oldaktcontinuelabel;
|
||||||
|
aktbreaklabel:=oldaktbreaklabel;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure secondon(var p : ptree);
|
procedure secondon(var p : ptree);
|
||||||
@ -781,18 +782,21 @@ do_jmp:
|
|||||||
usedinproc:=usedinproc or ($80 shr byte(R_EAX));
|
usedinproc:=usedinproc or ($80 shr byte(R_EAX));
|
||||||
getlabel(finallylabel);
|
getlabel(finallylabel);
|
||||||
getlabel(endfinallylabel);
|
getlabel(endfinallylabel);
|
||||||
oldaktcontinuelabel:=aktcontinuelabel;
|
|
||||||
oldaktbreaklabel:=aktbreaklabel;
|
|
||||||
oldaktexitlabel:=aktexitlabel;
|
oldaktexitlabel:=aktexitlabel;
|
||||||
oldaktexit2label:=aktexit2label;
|
oldaktexit2label:=aktexit2label;
|
||||||
getlabel(reraiselabel);
|
getlabel(reraiselabel);
|
||||||
getlabel(exitfinallylabel);
|
getlabel(exitfinallylabel);
|
||||||
getlabel(breakfinallylabel);
|
|
||||||
getlabel(continuefinallylabel);
|
|
||||||
aktcontinuelabel:=continuefinallylabel;
|
|
||||||
aktbreaklabel:=breakfinallylabel;
|
|
||||||
aktexitlabel:=exitfinallylabel;
|
aktexitlabel:=exitfinallylabel;
|
||||||
aktexit2label:=exitfinallylabel;
|
aktexit2label:=exitfinallylabel;
|
||||||
|
if assigned(aktbreaklabel) then
|
||||||
|
begin
|
||||||
|
oldaktcontinuelabel:=aktcontinuelabel;
|
||||||
|
oldaktbreaklabel:=aktbreaklabel;
|
||||||
|
getlabel(breakfinallylabel);
|
||||||
|
getlabel(continuefinallylabel);
|
||||||
|
aktcontinuelabel:=continuefinallylabel;
|
||||||
|
aktbreaklabel:=breakfinallylabel;
|
||||||
|
end;
|
||||||
|
|
||||||
push_int(1); { Type of stack-frame must be pushed}
|
push_int(1); { Type of stack-frame must be pushed}
|
||||||
emitcall('FPC_PUSHEXCEPTADDR');
|
emitcall('FPC_PUSHEXCEPTADDR');
|
||||||
@ -829,7 +833,7 @@ do_jmp:
|
|||||||
emitjmp(C_Z,reraiselabel);
|
emitjmp(C_Z,reraiselabel);
|
||||||
emit_reg(A_DEC,S_L,R_EAX);
|
emit_reg(A_DEC,S_L,R_EAX);
|
||||||
emitjmp(C_Z,oldaktexitlabel);
|
emitjmp(C_Z,oldaktexitlabel);
|
||||||
if assigned(oldaktbreaklabel) then
|
if assigned(aktbreaklabel) then
|
||||||
begin
|
begin
|
||||||
emit_reg(A_DEC,S_L,R_EAX);
|
emit_reg(A_DEC,S_L,R_EAX);
|
||||||
emitjmp(C_Z,oldaktbreaklabel);
|
emitjmp(C_Z,oldaktbreaklabel);
|
||||||
@ -844,7 +848,7 @@ do_jmp:
|
|||||||
emit_reg(A_POP,S_L,R_EAX);
|
emit_reg(A_POP,S_L,R_EAX);
|
||||||
emit_const(A_PUSH,S_L,2);
|
emit_const(A_PUSH,S_L,2);
|
||||||
emitjmp(C_NONE,finallylabel);
|
emitjmp(C_NONE,finallylabel);
|
||||||
if assigned(oldaktbreaklabel) then
|
if assigned(aktbreaklabel) then
|
||||||
begin
|
begin
|
||||||
emitlab(breakfinallylabel);
|
emitlab(breakfinallylabel);
|
||||||
emit_reg(A_POP,S_L,R_EAX);
|
emit_reg(A_POP,S_L,R_EAX);
|
||||||
@ -860,8 +864,11 @@ do_jmp:
|
|||||||
|
|
||||||
aktexitlabel:=oldaktexitlabel;
|
aktexitlabel:=oldaktexitlabel;
|
||||||
aktexit2label:=oldaktexit2label;
|
aktexit2label:=oldaktexit2label;
|
||||||
aktcontinuelabel:=oldaktcontinuelabel;
|
if assigned(aktbreaklabel) then
|
||||||
aktbreaklabel:=oldaktbreaklabel;
|
begin
|
||||||
|
aktcontinuelabel:=oldaktcontinuelabel;
|
||||||
|
aktbreaklabel:=oldaktbreaklabel;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -878,7 +885,10 @@ do_jmp:
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.64 1999-12-22 01:01:46 peter
|
Revision 1.65 1999-12-22 23:30:06 peter
|
||||||
|
* nested try blocks work again
|
||||||
|
|
||||||
|
Revision 1.64 1999/12/22 01:01:46 peter
|
||||||
- removed freelabel()
|
- removed freelabel()
|
||||||
* added undefined label detection in internal assembler, this prevents
|
* added undefined label detection in internal assembler, this prevents
|
||||||
a lot of ld crashes and wrong .o files
|
a lot of ld crashes and wrong .o files
|
||||||
|
Loading…
Reference in New Issue
Block a user