* allow and properly handle @classtype(pointerconst).field (mantis #15415)

git-svn-id: trunk@14462 -
This commit is contained in:
Jonas Maebe 2009-12-22 15:19:05 +00:00
parent 8cecea9b53
commit 1a87386bfe
3 changed files with 18 additions and 0 deletions

1
.gitattributes vendored
View File

@ -10151,6 +10151,7 @@ tests/webtbs/tw15364.pp svneol=native#text/plain
tests/webtbs/tw15370.pp svneol=native#text/plain
tests/webtbs/tw15377.pp svneol=native#text/pascal
tests/webtbs/tw1539.pp svneol=native#text/plain
tests/webtbs/tw15415.pp svneol=native#text/plain
tests/webtbs/tw1567.pp svneol=native#text/plain
tests/webtbs/tw1573.pp svneol=native#text/plain
tests/webtbs/tw1592.pp svneol=native#text/plain

View File

@ -308,6 +308,11 @@ implementation
location.reference.base:=cg.getaddressregister(current_asmdata.CurrAsmList);
cg.a_load_loc_reg(current_asmdata.CurrAsmList,OS_ADDR,left.location,location.reference.base);
end;
LOC_CONSTANT:
begin
{ can happen with @classtype(pointerconst).field }
location.reference.offset:=left.location.value;
end;
else
internalerror(2009092401);
end;

12
tests/webtbs/tw15415.pp Normal file
View File

@ -0,0 +1,12 @@
{$mode delphi}
type
TMyClass = class
i, i2 :Integer;
end;
begin
if ptruint(@TMyClass(pointer(5)).i2)<>(5+sizeof(pointer)+4) then
halt(1);
end.