From 8ce4f9606dbbae08b8cd9c7060ff6021943489dc Mon Sep 17 00:00:00 2001 From: svenbarth Date: Fri, 12 Jul 2019 22:07:41 +0000 Subject: [PATCH] * explicitely store the procdef of the picked constructor of the attribute git-svn-id: trunk@42400 - --- compiler/pdecl.pas | 2 +- compiler/symdef.pas | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/pdecl.pas b/compiler/pdecl.pas index 7ebf9915b2..dda6d78bbf 100644 --- a/compiler/pdecl.pas +++ b/compiler/pdecl.pas @@ -502,7 +502,7 @@ implementation to the property which is defined next. } if not assigned(rtti_attrs_def) then rtti_attrs_def:=trtti_attribute_list.create; - rtti_attrs_def.addattribute(typesym,pcalln,paras); + rtti_attrs_def.addattribute(typesym,tcallnode(pcalln).procdefinition,pcalln,paras); end else pcalln.free; diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 1a9c14e089..af0c957295 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -62,6 +62,7 @@ interface trtti_attribute = class typesym : tsym; + typeconstr : tdef; constructorcall : tnode; constructorpd : tdef; paras : array of tnode; @@ -73,7 +74,7 @@ interface { if the attribute list is bound to a def or symbol } is_bound : Boolean; class procedure bind(var dangling,owned:trtti_attribute_list); - procedure addattribute(atypesym:tsym;constructorcall:tnode;constref paras:array of tnode); + procedure addattribute(atypesym:tsym;typeconstr:tdef;constructorcall:tnode;constref paras:array of tnode); destructor destroy; override; function get_attribute_count:longint; end; @@ -2937,7 +2938,7 @@ implementation dangling:=nil; end; - procedure trtti_attribute_list.addattribute(atypesym:tsym;constructorcall:tnode;constref paras:array of tnode); + procedure trtti_attribute_list.addattribute(atypesym:tsym;typeconstr:tdef;constructorcall:tnode;constref paras:array of tnode); var newattribute : trtti_attribute; i : sizeint; @@ -2946,6 +2947,7 @@ implementation rtti_attributes:=TFPObjectList.Create(true); newattribute:=trtti_attribute.Create; newattribute.typesym:=atypesym; + newattribute.typeconstr:=typeconstr; newattribute.constructorcall:=constructorcall; setlength(newattribute.paras,length(paras)); for i:=0 to high(paras) do