mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 16:30:41 +02:00
* support LOC_CONSTANT for loading self pointer
git-svn-id: trunk@5086 -
This commit is contained in:
parent
5603955795
commit
3c5d82d2d1
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -7570,6 +7570,7 @@ tests/webtbs/tw7527.pp svneol=native#text/plain
|
||||
tests/webtbs/tw7567.pp svneol=native#text/plain
|
||||
tests/webtbs/tw7568.pp svneol=native#text/plain
|
||||
tests/webtbs/tw7637.pp svneol=native#text/plain
|
||||
tests/webtbs/tw7643.pp svneol=native#text/plain
|
||||
tests/webtbs/tw7679.pp svneol=native#text/plain
|
||||
tests/webtbs/ub1873.pp svneol=native#text/plain
|
||||
tests/webtbs/ub1883.pp svneol=native#text/plain
|
||||
|
@ -297,13 +297,6 @@ implementation
|
||||
internalerror(200312011);
|
||||
if assigned(left) then
|
||||
begin
|
||||
{
|
||||
THIS IS A TERRIBLE HACK!!!!!! WHICH WILL NOT WORK
|
||||
ON 64-BIT SYSTEMS: SINCE PROCSYM FOR METHODS
|
||||
CONSISTS OF TWO OS_ADDR, so you cannot set it
|
||||
to OS_64 - how to solve?? Carl
|
||||
Solved. Florian
|
||||
}
|
||||
if (sizeof(aint) = 4) then
|
||||
location_reset(location,LOC_CREFERENCE,OS_64)
|
||||
else if (sizeof(aint) = 8) then
|
||||
@ -314,6 +307,8 @@ implementation
|
||||
secondpass(left);
|
||||
|
||||
{ load class instance address }
|
||||
if left.location.loc=LOC_CONSTANT then
|
||||
location_force_reg(current_asmdata.CurrAsmList,left.location,OS_ADDR,false);
|
||||
case left.location.loc of
|
||||
LOC_CREGISTER,
|
||||
LOC_REGISTER:
|
||||
@ -334,7 +329,7 @@ implementation
|
||||
location_freetemp(current_asmdata.CurrAsmList,left.location);
|
||||
end;
|
||||
else
|
||||
internalerror(26019);
|
||||
internalerror(200610311);
|
||||
end;
|
||||
|
||||
{ store the class instance address }
|
||||
|
33
tests/webtbs/tw7643.pp
Normal file
33
tests/webtbs/tw7643.pp
Normal file
@ -0,0 +1,33 @@
|
||||
{$mode objfpc}
|
||||
|
||||
type
|
||||
TMethod = procedure of object;
|
||||
|
||||
TDummy = class
|
||||
procedure Method;
|
||||
end;
|
||||
|
||||
tr=record
|
||||
i1,i2 : longint;
|
||||
end;
|
||||
pr=^tr;
|
||||
|
||||
procedure TDummy.Method;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure DoSomething(Method: TMethod);
|
||||
begin
|
||||
end;
|
||||
|
||||
var
|
||||
Dummy: TDummy;
|
||||
r : tr;
|
||||
i : longint;
|
||||
begin
|
||||
i:=ptrint(@pr(nil)^.i2);
|
||||
{ Dummy := nil;
|
||||
DoSomething(@Dummy.Method);}
|
||||
DoSomething(@TDummy(nil).Method);
|
||||
|
||||
end.
|
Loading…
Reference in New Issue
Block a user