mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-08 19:26:38 +02:00
* when creating a bare procdef copy, don't copy the funcret parameter.
This is useful if you want to change the calling convention of the copy. o call insert_funcret_para() after creating a bare copy * don't copy aliasnames of copied procdefs either (can at best result in duplicate symbol errors) git-svn-id: trunk@28227 -
This commit is contained in:
parent
256f2fcf69
commit
627c83e828
@ -505,6 +505,7 @@ implementation
|
|||||||
methoddef:=tprocdef(tprocvardef(def).getcopyas(procdef,pc_bareproc));
|
methoddef:=tprocdef(tprocvardef(def).getcopyas(procdef,pc_bareproc));
|
||||||
finish_copied_procdef(methoddef,'invoke',pvclass.symtable,pvclass);
|
finish_copied_procdef(methoddef,'invoke',pvclass.symtable,pvclass);
|
||||||
insert_self_and_vmt_para(methoddef);
|
insert_self_and_vmt_para(methoddef);
|
||||||
|
insert_funcret_para(methoddef);
|
||||||
methoddef.synthetickind:=tsk_jvm_procvar_invoke;
|
methoddef.synthetickind:=tsk_jvm_procvar_invoke;
|
||||||
methoddef.calcparas;
|
methoddef.calcparas;
|
||||||
|
|
||||||
@ -539,6 +540,7 @@ implementation
|
|||||||
methoddef:=tprocdef(tprocvardef(def).getcopyas(procdef,pc_bareproc));
|
methoddef:=tprocdef(tprocvardef(def).getcopyas(procdef,pc_bareproc));
|
||||||
finish_copied_procdef(methoddef,name+'Callback',pvintf.symtable,pvintf);
|
finish_copied_procdef(methoddef,name+'Callback',pvintf.symtable,pvintf);
|
||||||
insert_self_and_vmt_para(methoddef);
|
insert_self_and_vmt_para(methoddef);
|
||||||
|
insert_funcret_para(methoddef);
|
||||||
{ can't be final/static/private/protected, and must be virtual
|
{ can't be final/static/private/protected, and must be virtual
|
||||||
since it's an interface method }
|
since it's an interface method }
|
||||||
methoddef.procoptions:=methoddef.procoptions-[po_staticmethod,po_finalmethod];
|
methoddef.procoptions:=methoddef.procoptions-[po_staticmethod,po_finalmethod];
|
||||||
@ -680,6 +682,7 @@ implementation
|
|||||||
{ since it was a bare copy, insert the self parameter (we can't just
|
{ since it was a bare copy, insert the self parameter (we can't just
|
||||||
copy the vmt parameter from the constructor, that's different) }
|
copy the vmt parameter from the constructor, that's different) }
|
||||||
insert_self_and_vmt_para(wrapperpd);
|
insert_self_and_vmt_para(wrapperpd);
|
||||||
|
insert_funcret_para(wrapperpd);
|
||||||
wrapperpd.calcparas;
|
wrapperpd.calcparas;
|
||||||
{ implementation: call through to the constructor
|
{ implementation: call through to the constructor
|
||||||
Exception: if the current class is abstract, do not call the
|
Exception: if the current class is abstract, do not call the
|
||||||
|
@ -4453,7 +4453,7 @@ implementation
|
|||||||
{ in case of bare proc, don't copy self, vmt or framepointer
|
{ in case of bare proc, don't copy self, vmt or framepointer
|
||||||
parameters }
|
parameters }
|
||||||
if (copytyp=pc_bareproc) and
|
if (copytyp=pc_bareproc) and
|
||||||
(([vo_is_self,vo_is_vmt,vo_is_parentfp,vo_is_result]*pvs.varoptions)<>[]) then
|
(([vo_is_self,vo_is_vmt,vo_is_parentfp,vo_is_result,vo_is_funcret]*pvs.varoptions)<>[]) then
|
||||||
continue;
|
continue;
|
||||||
npvs:=cparavarsym.create(pvs.realname,pvs.paranr,pvs.varspez,
|
npvs:=cparavarsym.create(pvs.realname,pvs.paranr,pvs.varspez,
|
||||||
pvs.vardef,pvs.varoptions);
|
pvs.vardef,pvs.varoptions);
|
||||||
@ -5188,7 +5188,11 @@ implementation
|
|||||||
tprocdef(result).deprecatedmsg:=stringdup(deprecatedmsg^);
|
tprocdef(result).deprecatedmsg:=stringdup(deprecatedmsg^);
|
||||||
{ will have to be associated with appropriate procsym }
|
{ will have to be associated with appropriate procsym }
|
||||||
tprocdef(result).procsym:=nil;
|
tprocdef(result).procsym:=nil;
|
||||||
|
{ don't create aliases for bare copies, nor copy the funcretsym as
|
||||||
|
the function result parameter will be inserted again if necessary
|
||||||
|
(e.g. if the calling convention is changed) }
|
||||||
if copytyp<>pc_bareproc then
|
if copytyp<>pc_bareproc then
|
||||||
|
begin
|
||||||
tprocdef(result).aliasnames.concatListcopy(aliasnames);
|
tprocdef(result).aliasnames.concatListcopy(aliasnames);
|
||||||
if assigned(funcretsym) then
|
if assigned(funcretsym) then
|
||||||
begin
|
begin
|
||||||
@ -5207,6 +5211,7 @@ implementation
|
|||||||
else
|
else
|
||||||
internalerror(2011040605);
|
internalerror(2011040605);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
{ will have to be associated with a new struct }
|
{ will have to be associated with a new struct }
|
||||||
tprocdef(result).struct:=nil;
|
tprocdef(result).struct:=nil;
|
||||||
if assigned(implprocdefinfo) then
|
if assigned(implprocdefinfo) then
|
||||||
|
Loading…
Reference in New Issue
Block a user