mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 16:49:20 +02:00
* fixed second_proc_to_procvar for 8086 after r32553
git-svn-id: trunk@32592 -
This commit is contained in:
parent
da696057ab
commit
4821fa7c67
@ -517,6 +517,8 @@ interface
|
|||||||
var
|
var
|
||||||
href: treference;
|
href: treference;
|
||||||
tmpreg: tregister;
|
tmpreg: tregister;
|
||||||
|
procvarrectype: trecorddef;
|
||||||
|
procvarselfname: TIDString;
|
||||||
begin
|
begin
|
||||||
if tabstractprocdef(resultdef).is_addressonly then
|
if tabstractprocdef(resultdef).is_addressonly then
|
||||||
begin
|
begin
|
||||||
@ -574,14 +576,24 @@ interface
|
|||||||
location_reset_ref(location,LOC_REFERENCE,int_cgsize(resultdef.size),sizeof(pint));
|
location_reset_ref(location,LOC_REFERENCE,int_cgsize(resultdef.size),sizeof(pint));
|
||||||
tg.gethltemp(current_asmdata.CurrAsmList,resultdef,resultdef.size,tt_normal,location.reference);
|
tg.gethltemp(current_asmdata.CurrAsmList,resultdef,resultdef.size,tt_normal,location.reference);
|
||||||
href:=location.reference;
|
href:=location.reference;
|
||||||
hlcg.g_ptrtypecast_ref(current_asmdata.CurrAsmList,cpointerdef.getreusable(resultdef),cpointerdef.getreusable(methodpointertype),href);
|
if is_nested_pd(tabstractprocdef(resultdef)) then
|
||||||
|
begin
|
||||||
|
procvarrectype:=trecorddef(nestedprocpointertype);
|
||||||
|
procvarselfname:='parentfp';
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
procvarrectype:=trecorddef(methodpointertype);
|
||||||
|
procvarselfname:='self';
|
||||||
|
end;
|
||||||
|
hlcg.g_ptrtypecast_ref(current_asmdata.CurrAsmList,cpointerdef.getreusable(resultdef),cpointerdef.getreusable(procvarrectype),href);
|
||||||
tmpreg:=hlcg.getaddressregister(current_asmdata.CurrAsmList,voidcodepointertype);
|
tmpreg:=hlcg.getaddressregister(current_asmdata.CurrAsmList,voidcodepointertype);
|
||||||
hlcg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,tprocdef(left.resultdef),voidcodepointertype,left.location.reference,tmpreg);
|
hlcg.a_loadaddr_ref_reg(current_asmdata.CurrAsmList,tprocdef(left.resultdef),voidcodepointertype,left.location.reference,tmpreg);
|
||||||
hlcg.g_load_reg_field_by_name(current_asmdata.CurrAsmList,voidcodepointertype,trecorddef(methodpointertype),tmpreg,'proc',href);
|
hlcg.g_load_reg_field_by_name(current_asmdata.CurrAsmList,voidcodepointertype,trecorddef(procvarrectype),tmpreg,'proc',href);
|
||||||
{ setting the frame pointer to nil is not strictly necessary
|
{ setting the frame pointer to nil is not strictly necessary
|
||||||
since the global procedure won't use it, but it can help with
|
since the global procedure won't use it, but it can help with
|
||||||
debugging }
|
debugging }
|
||||||
hlcg.g_load_const_field_by_name(current_asmdata.CurrAsmList,trecorddef(methodpointertype),'self',0,href);
|
hlcg.g_load_const_field_by_name(current_asmdata.CurrAsmList,trecorddef(procvarrectype),procvarselfname,0,href);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user