mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 11:09:19 +02:00
* support local labels in references
git-svn-id: trunk@764 -
This commit is contained in:
parent
0e89afa607
commit
2e00bd1480
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -5489,6 +5489,7 @@ tests/webtbf/tw3738.pp svneol=native#text/plain
|
|||||||
tests/webtbf/tw3740.pp svneol=native#text/plain
|
tests/webtbf/tw3740.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw3790.pp svneol=native#text/plain
|
tests/webtbf/tw3790.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw3841.pp svneol=native#text/plain
|
tests/webtbf/tw3841.pp svneol=native#text/plain
|
||||||
|
tests/webtbf/tw3931b.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw3969.pp svneol=native#text/plain
|
tests/webtbf/tw3969.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw4103.pp svneol=native#text/plain
|
tests/webtbf/tw4103.pp svneol=native#text/plain
|
||||||
tests/webtbf/tw4104.pp svneol=native#text/plain
|
tests/webtbf/tw4104.pp svneol=native#text/plain
|
||||||
@ -6114,6 +6115,7 @@ tests/webtbs/tw3898.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw3899.pp svneol=native#text/plain
|
tests/webtbs/tw3899.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3900.pp svneol=native#text/plain
|
tests/webtbs/tw3900.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3913.pp svneol=native#text/plain
|
tests/webtbs/tw3913.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw3931a.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3939.pp svneol=native#text/plain
|
tests/webtbs/tw3939.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3953a.pp svneol=native#text/plain
|
tests/webtbs/tw3953a.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3953b.pp svneol=native#text/plain
|
tests/webtbs/tw3953b.pp svneol=native#text/plain
|
||||||
|
@ -1095,6 +1095,7 @@ Unit Ra386int;
|
|||||||
hreg : tregister;
|
hreg : tregister;
|
||||||
GotStar,GotOffset,HadVar,
|
GotStar,GotOffset,HadVar,
|
||||||
GotPlus,Negative : boolean;
|
GotPlus,Negative : boolean;
|
||||||
|
hl : tasmlabel;
|
||||||
Begin
|
Begin
|
||||||
Consume(AS_LBRACKET);
|
Consume(AS_LBRACKET);
|
||||||
if not(oper.opr.typ in [OPR_LOCAL,OPR_REFERENCE]) then
|
if not(oper.opr.typ in [OPR_LOCAL,OPR_REFERENCE]) then
|
||||||
@ -1114,8 +1115,6 @@ Unit Ra386int;
|
|||||||
Begin
|
Begin
|
||||||
if not GotPlus then
|
if not GotPlus then
|
||||||
Message(asmr_e_invalid_reference_syntax);
|
Message(asmr_e_invalid_reference_syntax);
|
||||||
if actasmpattern[1] = '@' then
|
|
||||||
Message(asmr_e_local_label_not_allowed_as_ref);
|
|
||||||
GotStar:=false;
|
GotStar:=false;
|
||||||
GotPlus:=false;
|
GotPlus:=false;
|
||||||
if SearchIConstant(actasmpattern,l) or
|
if SearchIConstant(actasmpattern,l) or
|
||||||
@ -1168,6 +1167,14 @@ Unit Ra386int;
|
|||||||
if oper.opr.typ in [OPR_REFERENCE,OPR_LOCAL] then
|
if oper.opr.typ in [OPR_REFERENCE,OPR_LOCAL] then
|
||||||
oper.SetSize(typesize,true);
|
oper.SetSize(typesize,true);
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
if is_locallabel(tempstr) then
|
||||||
|
begin
|
||||||
|
CreateLocalLabel(tempstr,hl,false);
|
||||||
|
oper.InitRef;
|
||||||
|
oper.opr.ref.symbol:=hl;
|
||||||
|
oper.hasvar:=true;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if oper.SetupVar(tempstr,GotOffset) then
|
if oper.SetupVar(tempstr,GotOffset) then
|
||||||
begin
|
begin
|
||||||
|
16
tests/webtbf/tw3931b.pp
Executable file
16
tests/webtbf/tw3931b.pp
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
{ %fail }
|
||||||
|
{ %cpu=i386 }
|
||||||
|
|
||||||
|
{$asmmode intel}
|
||||||
|
|
||||||
|
procedure SmallForwardMove_3; assembler;
|
||||||
|
asm
|
||||||
|
jmp dword ptr [@@FwdJumpTable+@@FwdJumpTable+ecx*4]
|
||||||
|
nop {Align Jump Table}
|
||||||
|
@@Done:
|
||||||
|
@@FwdJumpTable:
|
||||||
|
dd @@Done {Removes need to test for zero size move}
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
15
tests/webtbs/tw3931a.pp
Executable file
15
tests/webtbs/tw3931a.pp
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
{ %cpu=i386 }
|
||||||
|
|
||||||
|
{$asmmode intel}
|
||||||
|
|
||||||
|
procedure SmallForwardMove_3; assembler;
|
||||||
|
asm
|
||||||
|
jmp dword ptr [@@FwdJumpTable+ecx*4]
|
||||||
|
nop {Align Jump Table}
|
||||||
|
@@Done:
|
||||||
|
@@FwdJumpTable:
|
||||||
|
dd @@Done {Removes need to test for zero size move}
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user