summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaul <paul@3ad0048d-3df7-0310-abae-a5850022a9f2>2009-11-01 16:01:23 +0000
committerpaul <paul@3ad0048d-3df7-0310-abae-a5850022a9f2>2009-11-01 16:01:23 +0000
commite07e56e3bad8267703f2e4a560452705cdc3cebc (patch)
tree51c28daec851585d00c918d365b6f316a687e51c
parent9ccf7a0b07333c3afa7106aa776daf018ef7454b (diff)
downloadfpc-e07e56e3bad8267703f2e4a560452705cdc3cebc.tar.gz
compiler: don't write zero ClassInfo pointer even if class does not have published methods rtti (issue #14930)
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@14004 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/nobj.pas5
-rw-r--r--tests/test/tclassinfo1.pp11
2 files changed, 12 insertions, 4 deletions
diff --git a/compiler/nobj.pas b/compiler/nobj.pas
index 5922e15eae..d992b2b6cd 100644
--- a/compiler/nobj.pas
+++ b/compiler/nobj.pas
@@ -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)))
diff --git a/tests/test/tclassinfo1.pp b/tests/test/tclassinfo1.pp
new file mode 100644
index 0000000000..7358630223
--- /dev/null
+++ b/tests/test/tclassinfo1.pp
@@ -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.
+