compiler: don't write zero ClassInfo pointer even if class does not have published methods rtti (issue #14930)

git-svn-id: trunk@14004 -
This commit is contained in:
paul 2009-11-01 16:01:23 +00:00
parent a13c657e69
commit dfdfec0201
3 changed files with 13 additions and 4 deletions

1
.gitattributes vendored
View File

@ -8188,6 +8188,7 @@ tests/test/tclass5.pp svneol=native#text/plain
tests/test/tclass6.pp svneol=native#text/plain
tests/test/tclass7.pp svneol=native#text/plain
tests/test/tclass8.pp svneol=native#text/plain
tests/test/tclassinfo1.pp svneol=native#text/pascal
tests/test/tclrprop.pp svneol=native#text/plain
tests/test/tcmp.pp svneol=native#text/plain
tests/test/tcmp0.pp svneol=native#text/plain

View File

@ -1315,10 +1315,7 @@ implementation
{ pointer to field table }
current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(fieldtablelabel));
{ pointer to type info of published section }
if (oo_can_have_published in _class.objectoptions) then
current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(RTTIWriter.get_rtti_label(_class,fullrtti)))
else
current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(nil));
current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(RTTIWriter.get_rtti_label(_class,fullrtti)));
{ inittable for con-/destruction }
if _class.members_need_inittable then
current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(RTTIWriter.get_rtti_label(_class,initrtti)))

11
tests/test/tclassinfo1.pp Normal file
View File

@ -0,0 +1,11 @@
program tclassinfo1;
{$apptype console}
{$mode objfpc}{$H+}
uses
Classes;
begin
WriteLn(TObject.ClassInfo = TypeInfo(TObject));
WriteLn(TPersistent.ClassInfo = TypeInfo(TPersistent));
end.