+ support for [recordfield.field] in assembler blocks in methods in

intel assembler (mantis 8171)

git-svn-id: trunk@6150 -
This commit is contained in:
Jonas Maebe 2007-01-23 17:34:11 +00:00
parent fcb128c66c
commit ed13c7f60e
4 changed files with 54 additions and 2 deletions

1
.gitattributes vendored
View File

@ -7991,6 +7991,7 @@ tests/webtbs/tw8150a.pp svneol=native#text/plain
tests/webtbs/tw8150d.pp svneol=native#text/plain
tests/webtbs/tw8155.pp svneol=native#text/plain
tests/webtbs/tw8156.pp svneol=native#text/plain
tests/webtbs/tw8171.pp svneol=native#text/plain
tests/webtbs/tw8183.pp svneol=native#text/plain
tests/webtbs/ub1873.pp svneol=native#text/plain
tests/webtbs/ub1883.pp svneol=native#text/plain

View File

@ -1202,6 +1202,14 @@ Begin
exit;
end;
end;
fieldvarsym :
begin
if (tfieldvarsym(srsym).vardef.typ in [recorddef,objectdef]) then
begin
SearchRecordType:=true;
exit;
end;
end;
end;
end;
end;

View File

@ -982,6 +982,10 @@ Unit Rax86int;
if not(ttypesym(sym).typedef.typ in [recorddef,objectdef]) then
Message(asmr_e_wrong_sym_type);
end;
fieldvarsym :
begin
tempstr:='SELF.'+tempstr;
end;
else
Message(asmr_e_wrong_sym_type);
end;
@ -1014,8 +1018,10 @@ Unit Rax86int;
else
Message(asmr_e_only_add_relocatable_symbol);
end;
if actasmtoken=AS_DOT then
begin
if (actasmtoken=AS_DOT) or
(assigned(sym) and
(sym.typ = fieldvarsym)) then
begin
BuildRecordOffsetSize(tempstr,l,k,hs);
if hs <> '' then
hssymtyp:=AT_FUNCTION

37
tests/webtbs/tw8171.pp Normal file
View File

@ -0,0 +1,37 @@
{ %cpu=i386 }
program FieldDoesntResolve;
{$IFDEF FPC}
{$mode delphi}
{$ENDIF}
type
TMyRecord = record
rField: Integer;
end;
TMyObject = class
private
oField: TMyRecord;
public
procedure Test;
end;
{ TMyObject }
procedure TMyObject.Test;
asm
// mov [eax + TMyObject.oField.rField], 0 // works in Delphi and FPC
mov [eax + oField.rField], 5 // works only in Delphi
end;
begin
with TMyObject.Create do try
Test;
finally
if (ofield.rfield <> 5) then
halt(1);
Free;
end;
end.