فهرست منبع

* fix protected checking

peter 20 سال پیش
والد
کامیت
100a47e6af
2فایلهای تغییر یافته به همراه22 افزوده شده و 12 حذف شده
  1. 6 3
      compiler/symdef.pas
  2. 16 9
      compiler/symtype.pas

+ 6 - 3
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

+ 16 - 9
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.