* 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:
Jonas Maebe 2015-05-03 16:51:20 +00:00
parent 582aee4d90
commit fb8c61889b

View File

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