summaryrefslogtreecommitdiff
path: root/compiler/i386/ra386int.pas
diff options
context:
space:
mode:
authorpeter <peter@3ad0048d-3df7-0310-abae-a5850022a9f2>2005-07-29 07:06:12 +0000
committerpeter <peter@3ad0048d-3df7-0310-abae-a5850022a9f2>2005-07-29 07:06:12 +0000
commit814ca9b4cd4290243fb5da12496286dcd516947b (patch)
tree6ee8cbfd0368762b13b564eb673de6b1203d3373 /compiler/i386/ra386int.pas
parent721536ca4a214064ae4f2fbfa2bf74e69e96bd74 (diff)
downloadfpc-814ca9b4cd4290243fb5da12496286dcd516947b.tar.gz
* support local labels in references
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@764 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/i386/ra386int.pas')
-rw-r--r--compiler/i386/ra386int.pas11
1 files changed, 9 insertions, 2 deletions
diff --git a/compiler/i386/ra386int.pas b/compiler/i386/ra386int.pas
index 4f80643426..ba415084fd 100644
--- a/compiler/i386/ra386int.pas
+++ b/compiler/i386/ra386int.pas
@@ -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
@@ -1169,6 +1168,14 @@ Unit Ra386int;
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
{ force OPR_LOCAL to be a reference }