mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-16 06:10:34 +01:00
* allow and properly handle @classtype(pointerconst).field (mantis #15415)
git-svn-id: trunk@14462 -
This commit is contained in:
parent
8cecea9b53
commit
1a87386bfe
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
||||
@ -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
12
tests/webtbs/tw15415.pp
Normal 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.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user