mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 15:49:26 +02:00
* when getting a copy of a special procdef (such as a con/destructor) as a
procvardef, change the proctype into a regular procedure/function, because there are no "con/destructor procvar" types and there is code in the paramanager that expects e.g. a constructor to be always owned by an abstractrecorddef (which is not necessarily the case for the created procvardefs) git-svn-id: trunk@30786 -
This commit is contained in:
parent
582aee4d90
commit
fb8c61889b
@ -4708,7 +4708,25 @@ implementation
|
||||
end;
|
||||
tabstractprocdef(result).savesize:=savesize;
|
||||
|
||||
tabstractprocdef(result).proctypeoption:=proctypeoption;
|
||||
if (typ<>procvardef) and
|
||||
(newtyp=procvardef) then
|
||||
begin
|
||||
{ procvars can't be (class)constructures/destructors etc }
|
||||
if proctypeoption=potype_constructor then
|
||||
begin
|
||||
tabstractprocdef(result).returndef:=tdef(owner.defowner);
|
||||
if not(is_implicit_pointer_object_type(returndef) or
|
||||
(returndef.typ<>objectdef)) then
|
||||
tabstractprocdef(result).returndef:=getpointerdef(tabstractprocdef(result).returndef);
|
||||
tabstractprocdef(result).proctypeoption:=potype_function;
|
||||
end
|
||||
else if is_void(returndef) then
|
||||
tabstractprocdef(result).proctypeoption:=potype_procedure
|
||||
else
|
||||
tabstractprocdef(result).proctypeoption:=potype_function;
|
||||
end
|
||||
else
|
||||
tabstractprocdef(result).proctypeoption:=proctypeoption;
|
||||
tabstractprocdef(result).proccalloption:=proccalloption;
|
||||
tabstractprocdef(result).procoptions:=procoptions;
|
||||
if (copytyp=pc_bareproc) then
|
||||
|
Loading…
Reference in New Issue
Block a user