From 9b3b94883b1ae2a0dff381796001b7e034275edc Mon Sep 17 00:00:00 2001 From: marco Date: Fri, 12 Dec 2003 12:09:40 +0000 Subject: [PATCH] * always generate RTTI patch from peter --- compiler/pdecl.pas | 12 ++++++++---- compiler/symdef.pas | 12 ++++++++---- compiler/symsym.pas | 30 +++++++++--------------------- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/compiler/pdecl.pas b/compiler/pdecl.pas index 443b7ef8a8..6e2dda6aa5 100644 --- a/compiler/pdecl.pas +++ b/compiler/pdecl.pas @@ -526,6 +526,10 @@ implementation tt.def.needs_inittable) then generate_inittable(newtype); + { Always generate RTTI info for all types. This is to have typeinfo() return + the same pointer } + generate_rtti(newtype); + { for objects we should write the vmt and interfaces. This need to be done after the rtti has been written, because it can contain a reference to that data (PFV) @@ -537,9 +541,6 @@ implementation { generate and check virtual methods, must be done before RTTI is written } ch.genvmt; - { generate rtti info if published items are available } - if (oo_can_have_published in tobjectdef(tt.def).objectoptions) then - generate_rtti(newtype); if is_interface(tobjectdef(tt.def)) then ch.writeinterfaceids; if (oo_has_vmt in tobjectdef(tt.def).objectoptions) then @@ -655,7 +656,10 @@ implementation end. { $Log$ - Revision 1.73 2003-12-10 16:37:01 peter + Revision 1.74 2003-12-12 12:09:40 marco + * always generate RTTI patch from peter + + Revision 1.73 2003/12/10 16:37:01 peter * global property support for fpc modes Revision 1.72 2003/11/12 15:48:48 peter diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 885f9bb4c2..bb22dab580 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -5569,10 +5569,11 @@ implementation end; fullrtti : begin - if objecttype in [odt_interfacecom,odt_interfacecorba] then - rttiList.concat(Tai_const.Create_32bit(0)) + if (oo_has_vmt in objectoptions) and + not(objecttype in [odt_interfacecom,odt_interfacecorba]) then + rttiList.concat(Tai_const_symbol.Createname(vmt_mangledname)) else - rttiList.concat(Tai_const_symbol.Createname(vmt_mangledname)); + rttiList.concat(Tai_const.Create_32bit(0)); { write owner typeinfo } if assigned(childof) and (oo_can_have_published in childof.objectoptions) then @@ -6117,7 +6118,10 @@ implementation end. { $Log$ - Revision 1.191 2003-12-08 22:34:24 peter + Revision 1.192 2003-12-12 12:09:40 marco + * always generate RTTI patch from peter + + Revision 1.191 2003/12/08 22:34:24 peter * tai_const.create_32bit changed to cardinal Revision 1.190 2003/11/10 22:02:52 peter diff --git a/compiler/symsym.pas b/compiler/symsym.pas index c840824056..a791b43cc5 100644 --- a/compiler/symsym.pas +++ b/compiler/symsym.pas @@ -1511,15 +1511,15 @@ implementation ref:=_ref; end; - + destructor tabsolutesym.destroy; begin if assigned(ref) then ref.free; - inherited destroy; + inherited destroy; end; - - + + constructor tabsolutesym.ppuload(ppufile:tcompilerppufile); begin { Note: This needs to load everything of tvarsym.write } @@ -1583,9 +1583,6 @@ implementation procedure tabsolutesym.deref; - var - srsym : tsym; - srsymtable : tsymtable; begin { inheritance of varsym.deref ! } vartype.resolve; @@ -2596,20 +2593,8 @@ implementation function trttisym.mangledname : string; const prefix : array[trttitype] of string[5]=('RTTI_','INIT_'); - var - s : string; - p : tsymtable; begin - s:=''; - p:=owner; - while assigned(p) and (p.symtabletype=localsymtable) do - begin - s:=s+'_'+p.defowner.name; - p:=p.defowner.owner; - end; - if not(p.symtabletype in [globalsymtable,staticsymtable]) then - internalerror(200108265); - mangledname:=prefix[rttityp]+p.name^+s+'$_'+Copy(name,5,255); + result:=make_mangledname(prefix[rttityp],owner,Copy(name,5,255)); end; @@ -2699,7 +2684,10 @@ implementation end. { $Log$ - Revision 1.137 2003-12-01 18:44:15 peter + Revision 1.138 2003-12-12 12:09:40 marco + * always generate RTTI patch from peter + + Revision 1.137 2003/12/01 18:44:15 peter * fixed some crashes * fixed varargs and register calling probs