aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>2000-04-21 19:53:15 +0000
committerTom Tromey <tromey@gcc.gnu.org>2000-04-21 19:53:15 +0000
commit473e7b07f16b5099ecb3b788fa47da773974d8bc (patch)
tree9530e46d97e21ee149dae5456ea51dfcad551abf /gcc/java/parse.y
parentb3b42a4db6bd74ef385b4efbcf92ba621f35999f (diff)
downloadgcc-473e7b07f16b5099ecb3b788fa47da773974d8bc.zip
gcc-473e7b07f16b5099ecb3b788fa47da773974d8bc.tar.gz
gcc-473e7b07f16b5099ecb3b788fa47da773974d8bc.tar.bz2
re GNATS gcj/124 (protected constructor for InvocationTargetException still visible)
* parse.y (not_accessible_p): Use member's class, not current class, when doing inheritance check for protected reference. Fixes PR gcj/124. From-SVN: r33315
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index d427c34..63ee67d 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -9125,14 +9125,14 @@ not_accessible_p (reference, member, from_super)
/* Otherwise, access is granted if occuring from the class where
member is declared or a subclass of it */
- if (inherits_from_p (reference, current_class))
+ if (inherits_from_p (reference, DECL_CONTEXT (member)))
return 0;
return 1;
}
/* Check access on private members. Access is granted only if it
- occurs from within the class in witch it is declared. Exceptions
- are access from inner-classes. This section is probably not
+ occurs from within the class in which it is declared. Exceptions
+ are accesses from inner-classes. This section is probably not
complete. FIXME */
if (access_flag & ACC_PRIVATE)
return (current_class == DECL_CONTEXT (member) ? 0 :
@@ -9143,7 +9143,7 @@ not_accessible_p (reference, member, from_super)
REFERENCE is defined in the current package */
if (ctxp->package)
return !class_in_current_package (reference);
-
+
/* Otherwise, access is granted */
return 0;
}