From 100a47e6af902ccc63dfd3173a89df27082a32c4 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 7 Mar 2005 17:58:27 +0000 Subject: [PATCH] * fix protected checking --- compiler/symdef.pas | 9 ++++++--- compiler/symtype.pas | 25 ++++++++++++++++--------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 96d43f842d..bcf7ffa8bf 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -310,7 +310,7 @@ interface function vmt_mangledname : string; function rtti_name : string; procedure check_forwards; - function is_related(d : tobjectdef) : boolean; + function is_related(d : tdef) : boolean;override; function next_free_name_index : longint; procedure insertvmt; procedure set_parent(c : tobjectdef); @@ -5173,7 +5173,7 @@ implementation { true, if self inherits from d (or if they are equal) } - function tobjectdef.is_related(d : tobjectdef) : boolean; + function tobjectdef.is_related(d : tdef) : boolean; var hp : tobjectdef; begin @@ -6394,7 +6394,10 @@ implementation end. { $Log$ - Revision 1.298 2005-02-26 15:43:09 florian + Revision 1.299 2005-03-07 17:58:27 peter + * fix protected checking + + Revision 1.298 2005/02/26 15:43:09 florian * userdata in file/textrecs now 32 bytes Revision 1.297 2005/02/14 17:13:07 peter diff --git a/compiler/symtype.pas b/compiler/symtype.pas index b1ad58c79d..a4c769ed8e 100644 --- a/compiler/symtype.pas +++ b/compiler/symtype.pas @@ -86,6 +86,7 @@ interface function getsymtable(t:tgetsymtable):tsymtable;virtual; function is_publishable:boolean;virtual;abstract; function needs_inittable:boolean;virtual;abstract; + function is_related(def:tdef):boolean;virtual; end; {************************************************ @@ -226,7 +227,6 @@ implementation uses verbose, fmodule -// symdef {$ifdef GDB} ,gdb {$endif GDB} @@ -288,10 +288,16 @@ implementation function tdef.getsymtable(t:tgetsymtable):tsymtable; begin - getsymtable:=nil; + result:=nil; end; + function tdef.is_related(def:tdef):boolean; + begin + result:=false; + end; + + {**************************************************************************** TSYM (base for all symtypes) ****************************************************************************} @@ -492,8 +498,10 @@ implementation (not owner.defowner.owner.iscurrentunit) ) and not( - assigned(currobjdef) {and - Tobjectdef(currobjdef).is_related(tobjectdef(owner.defowner))} + assigned(currobjdef) and + (currobjdef.owner.symtabletype in [globalsymtable,staticsymtable]) and + (currobjdef.owner.iscurrentunit) and + currobjdef.is_related(tdef(owner.defowner)) ) ) then exit; @@ -1454,7 +1462,10 @@ finalization end. { $Log$ - Revision 1.51 2005-02-14 17:13:09 peter + Revision 1.52 2005-03-07 17:58:27 peter + * fix protected checking + + Revision 1.51 2005/02/14 17:13:09 peter * truncate log Revision 1.50 2005/01/19 22:19:41 peter @@ -1462,7 +1473,3 @@ end. * new derefmap added } - - - -end.