mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 13:30:33 +02:00
* use tasbtractprocdef(resultdef).addresstype instead of voidcodepointertype in
tcgtypeconvnode.second_proc_to_procvar. In the future (it's not implemented yet), this will allow taking the address of near procedures (which would then produce a near procvar) in i8086 far code memory models. git-svn-id: trunk@38644 -
This commit is contained in:
parent
40f443a974
commit
0b66419e8b
@ -548,18 +548,18 @@ interface
|
||||
begin
|
||||
if tabstractprocdef(resultdef).is_addressonly then
|
||||
begin
|
||||
location_reset(location,LOC_REGISTER,def_cgsize(voidcodepointertype));
|
||||
location_reset(location,LOC_REGISTER,def_cgsize(tabstractprocdef(resultdef).address_type));
|
||||
{ only a code pointer? (when taking the address of classtype.method
|
||||
we also only get a code pointer even though the resultdef is a
|
||||
procedure of object, and hence is_addressonly would return false)
|
||||
}
|
||||
if left.location.size = def_cgsize(voidcodepointertype) then
|
||||
if left.location.size = def_cgsize(tabstractprocdef(resultdef).address_type) then
|
||||
begin
|
||||
case left.location.loc of
|
||||
LOC_REFERENCE,LOC_CREFERENCE:
|
||||
begin
|
||||
{ the procedure symbol is encoded in reference.symbol -> take address }
|
||||
location.register:=hlcg.getaddressregister(current_asmdata.CurrAsmList,voidcodepointertype);
|
||||
location.register:=hlcg.getaddressregister(current_asmdata.CurrAsmList,tabstractprocdef(resultdef).address_type);
|
||||
hlcg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,left.resultdef,resultdef,left.location.reference,location.register);
|
||||
end;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user