* 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:
nickysn 2018-03-29 15:11:14 +00:00
parent 40f443a974
commit 0b66419e8b

View File

@ -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