* inline asm fix for accessing record variables when using the unitname (e.g.

'mov ax, unitname.varname.fieldname')

git-svn-id: trunk@38755 -
This commit is contained in:
nickysn 2018-04-12 16:35:21 +00:00
parent 6060f474ed
commit bbc364b245
3 changed files with 36 additions and 0 deletions

1
.gitattributes vendored
View File

@ -12577,6 +12577,7 @@ tests/test/tasm25ss0.pp svneol=native#text/plain
tests/test/tasm25ss1.pp svneol=native#text/plain
tests/test/tasm25ss2.pp svneol=native#text/plain
tests/test/tasm25ss3.pp svneol=native#text/plain
tests/test/tasm26.pp svneol=native#text/plain
tests/test/tasm2a.pp svneol=native#text/plain
tests/test/tasm3.pp svneol=native#text/plain
tests/test/tasm4.pp svneol=native#text/plain

View File

@ -1509,6 +1509,16 @@ Begin
else
begin
asmsearchsym(base,sym,srsymtable);
{ allow unitname.identifier }
if assigned(sym) and (sym.typ=unitsym) then
begin
i:=pos('.',s);
if i=0 then
i:=255;
base:=base+'.'+Copy(s,1,i-1);
delete(s,1,i);
asmsearchsym(base,sym,srsymtable);
end;
st:=nil;
{ we can start with a var,type,typedconst }
if assigned(sym) then

25
tests/test/tasm26.pp Normal file
View File

@ -0,0 +1,25 @@
{ %CPU=i8086,i386,x86_64 }
{$IFDEF FPC}
{$MODE TP}
{$ASMMODE INTEL}
{$PIC OFF}
{$ENDIF FPC}
program tasm26;
type
t = record
a: word;
end;
var
v: t;
procedure x; assembler;
asm
mov ax, tasm26.v.a;
end;
begin
end.