mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-23 13:51:30 +01:00
* always create a new call node when replacing virtual class method calls
with wrapper calls, because the parameter nodes are already bound to the
paravarsyms of the current procdef so simply replacing the procsym and
procdef is not enough
git-svn-id: branches/jvmbackend@18739 -
This commit is contained in:
parent
084c76119b
commit
72c81d9eb1
@ -563,25 +563,15 @@ implementation
|
|||||||
if not assigned(sym) or
|
if not assigned(sym) or
|
||||||
(sym.typ<>procsym) then
|
(sym.typ<>procsym) then
|
||||||
internalerror(2011072801);
|
internalerror(2011072801);
|
||||||
{ check whether we can simply replace the symtableprocentry, or
|
{ do not simply replace the procsym/procdef in case we could
|
||||||
whether we have to reresolve overloads -- can never simply
|
in theory do that, because the parameter nodes have already
|
||||||
replace in case of constructor -> class method call, because
|
been bound to the current procdef's parasyms }
|
||||||
constructors have a vmt parameter and class methods don't }
|
remove_hidden_paras;
|
||||||
if (procdefinition.proctypeoption<>potype_constructor) and
|
result:=ccallnode.create(left,tprocsym(sym),symtableproc,methodpointer,callnodeflags);
|
||||||
(symtableprocentry.ProcdefList.count=1) then
|
result.flags:=flags;
|
||||||
begin
|
left:=nil;
|
||||||
symtableprocentry:=tprocsym(sym);
|
methodpointer:=nil;
|
||||||
procdefinition:=tprocdef(symtableprocentry.ProcdefList[0]);
|
exit;
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
remove_hidden_paras;
|
|
||||||
result:=ccallnode.create(left,tprocsym(sym),symtableproc,methodpointer,callnodeflags);
|
|
||||||
result.flags:=flags;
|
|
||||||
left:=nil;
|
|
||||||
methodpointer:=nil;
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
result:=inherited pass_1;
|
result:=inherited pass_1;
|
||||||
if assigned(result) then
|
if assigned(result) then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user