* support local labels in references

git-svn-id: trunk@764 -
This commit is contained in:
peter 2005-07-29 07:06:12 +00:00
parent 0e89afa607
commit 2e00bd1480
4 changed files with 42 additions and 2 deletions

2
.gitattributes vendored
View File

@ -5489,6 +5489,7 @@ tests/webtbf/tw3738.pp svneol=native#text/plain
tests/webtbf/tw3740.pp svneol=native#text/plain
tests/webtbf/tw3790.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/tw4103.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/tw3900.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/tw3953a.pp svneol=native#text/plain
tests/webtbs/tw3953b.pp svneol=native#text/plain

View File

@ -1095,6 +1095,7 @@ Unit Ra386int;
hreg : tregister;
GotStar,GotOffset,HadVar,
GotPlus,Negative : boolean;
hl : tasmlabel;
Begin
Consume(AS_LBRACKET);
if not(oper.opr.typ in [OPR_LOCAL,OPR_REFERENCE]) then
@ -1114,8 +1115,6 @@ Unit Ra386int;
Begin
if not GotPlus then
Message(asmr_e_invalid_reference_syntax);
if actasmpattern[1] = '@' then
Message(asmr_e_local_label_not_allowed_as_ref);
GotStar:=false;
GotPlus:=false;
if SearchIConstant(actasmpattern,l) or
@ -1168,6 +1167,14 @@ Unit Ra386int;
if oper.opr.typ in [OPR_REFERENCE,OPR_LOCAL] then
oper.SetSize(typesize,true);
end
else
if is_locallabel(tempstr) then
begin
CreateLocalLabel(tempstr,hl,false);
oper.InitRef;
oper.opr.ref.symbol:=hl;
oper.hasvar:=true;
end
else
if oper.SetupVar(tempstr,GotOffset) then
begin

16
tests/webtbf/tw3931b.pp Executable file
View 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
View 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.