RTTI missing property count for published interfaces
Original Reporter info from Mantis: jmd
-
Reporter name: Jared Davison
Original Reporter info from Mantis: jmd
- Reporter name: Jared Davison
Description:
No safe way to iterate through the published properties of an interface.
A patch is supplied to resolve issue in additional information section below.
Although this patch is for 2.6.0, we have checked the trunk Revision 25881 in svn today, and it is not yet resolved.
Inclusion of this patch in future releases of FPC would be much appreciated.
Steps to reproduce:
Use the attached IntfRTTI.dpr program to print out the interface properties. Without the patch the there would be a random list of properties and could potentially crash.
The test also shows array properties are not tagged as such.
Additional information:
Index: ncgrtti.pas
===================================================================
--- ncgrtti.pas (revision 23383)
+++ ncgrtti.pas (working copy)
@@ -856,6 +856,8 @@
maybe_write_align;
{ write published properties for this object }
+ current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_16bit(published_properties_count(def.symtable)));
+ maybe_write_align;
published_properties_write_rtti_data(propnamelist,def.symtable);
propnamelist.free;
Mantis conversion info:
- Mantis ID: 25254
- OS: All
- OS Build: All
- Build: 2.6.0
- Platform: All
- Version: 2.6.0
- Fixed in version: 3.1.1
- Fixed in revision: 32255 (#266ebc35)
- Monitored by: » jmd (Jared Davison), » luizamerico (Luiz Americo)