From 4dbf4496573255460757de76bb8347669196587c Mon Sep 17 00:00:00 2001 From: Alexandre Petit-Bianco Date: Thu, 20 Jul 2000 17:01:43 -0700 Subject: [multiple changes] 2000-07-13 Alexandre Petit-Bianco * parse.y (patch_method_invocation): Fixed comment. (maybe_use_access_method): Build this$s to the context of the target method, or a type that extends it. Fixes gcj/242. 2000-07-13 Alexandre Petit-Bianco * parse.y (not_accessible_p): Access granted to innerclasses (indirectly) extending the reference type. Fixes gcj/249. 2000-07-10 Alexandre Petit-Bianco * parse.y (resolve_qualified_expression_name): Verify qualified access to `this.' Fixes gcj/239. 2000-07-10 Alexandre Petit-Bianco * class.c (set_super_info): Handled protected inner classes. (common_enclosing_context_p): Bail early if arguments aren't both inner classes. (get_access_flags_from_decl): Handle private and protected inner classes. * java-tree.h (TYPE_PROTECTED_INNER_CLASS): New macro. (CLASS_PROTECTED): Likewise. (struct lang_type): New bitfield `poic.' * parse.y (jdep_resolve_class): Call check_inner_class_access on inner classes only. (check_inner_class_access): Renamed arguments, added comments. Handles protected inner classes (fixes gcj/225) (not_accessible_p): Fixed comments. Avoid handling inner classes. 2000-07-07 Alexandre Petit-Bianco * parse.y (resolve_qualified_expression_name): Handle inner class access. Fixes gcj/256. (Fixes gcj/242, gcj/249, gcj/239, gcj/225 and gcj/256: http://gcc.gnu.org/ml/gcc-patches/2000-07/msg00801.html) From-SVN: r35156 --- gcc/java/class.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/java/class.c') diff --git a/gcc/java/class.c b/gcc/java/class.c index d719f04..f99d0e5 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -401,6 +401,7 @@ set_super_info (access_flags, this_class, super_class, interfaces_count) if (access_flags & ACC_ABSTRACT) CLASS_ABSTRACT (class_decl) = 1; if (access_flags & ACC_STATIC) CLASS_STATIC (class_decl) = 1; if (access_flags & ACC_PRIVATE) CLASS_PRIVATE (class_decl) = 1; + if (access_flags & ACC_PROTECTED) CLASS_PROTECTED (class_decl) = 1; } /* Return length of inheritance chain of CLAS, where java.lang.Object is 0, @@ -493,7 +494,7 @@ enclosing_context_p (type1, type2) int common_enclosing_context_p (type1, type2) tree type1, type2; { - if (!PURE_INNER_CLASS_TYPE_P (type1) && !PURE_INNER_CLASS_TYPE_P (type2)) + if (!PURE_INNER_CLASS_TYPE_P (type1) || !PURE_INNER_CLASS_TYPE_P (type2)) return 0; for (type1 = TREE_TYPE (DECL_CONTEXT (TYPE_NAME (type1))); type1; @@ -1075,6 +1076,10 @@ get_access_flags_from_decl (decl) access_flags |= ACC_ABSTRACT; if (CLASS_STATIC (decl)) access_flags |= ACC_STATIC; + if (CLASS_PRIVATE (decl)) + access_flags |= ACC_PRIVATE; + if (CLASS_PROTECTED (decl)) + access_flags |= ACC_PROTECTED; return access_flags; } if (TREE_CODE (decl) == FUNCTION_DECL) -- cgit v1.1