mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:29:27 +02:00
+ tcgtypeconvnode.second_class_to_intf supports LOC_CONSTANT as well, resolves #31596
git-svn-id: trunk@35655 -
This commit is contained in:
parent
abc4cf21d1
commit
0cf5ef459d
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -15411,6 +15411,7 @@ tests/webtbs/tw3143.pp svneol=native#text/plain
|
||||
tests/webtbs/tw31431.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3144.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3157.pp svneol=native#text/plain
|
||||
tests/webtbs/tw31596.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3160a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3160b.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3160c.pp svneol=native#text/plain
|
||||
|
@ -736,6 +736,11 @@ interface
|
||||
begin
|
||||
location.register:=left.location.register;
|
||||
hlcg.g_ptrtypecast_reg(current_asmdata.CurrAsmList,left.resultdef,resultdef,location.register);
|
||||
end;
|
||||
LOC_CONSTANT:
|
||||
begin
|
||||
location.register:=hlcg.getaddressregister(current_asmdata.CurrAsmList,resultdef);
|
||||
hlcg.a_load_const_reg(current_asmdata.CurrAsmList,resultdef,left.location.value,location.register);
|
||||
end
|
||||
else
|
||||
internalerror(121120001);
|
||||
|
17
tests/webtbs/tw31596.pp
Normal file
17
tests/webtbs/tw31596.pp
Normal file
@ -0,0 +1,17 @@
|
||||
{ %norun }
|
||||
var
|
||||
|
||||
offset : Integer;
|
||||
o : TObject;
|
||||
|
||||
begin
|
||||
|
||||
// OK
|
||||
o := TObject(1);
|
||||
|
||||
offset := PtrInt(IInterface(TInterfacedObject(o))) - 1;
|
||||
//
|
||||
|
||||
// project1.lpr(17,19) Error: Internal error 121120001
|
||||
offset := PtrInt(IInterface(TInterfacedObject(1))) - 1;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user