aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@redhat.com>2001-03-26 14:12:16 -0800
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2001-03-26 14:12:16 -0800
commitce06965e6a9c46d6896ccb8a4553852a230c95fc (patch)
tree602715cc2492a4adc66e18cf92b70ba5933853fe /gcc/java/parse.y
parentd38a30c995c5d7abf7112f68c56a6f70d1e94019 (diff)
downloadgcc-ce06965e6a9c46d6896ccb8a4553852a230c95fc.zip
gcc-ce06965e6a9c46d6896ccb8a4553852a230c95fc.tar.gz
gcc-ce06965e6a9c46d6896ccb8a4553852a230c95fc.tar.bz2
parse.y (find_as_inner_class): Follow current package indications not to mistakingly load an unrelated class.
2001-03-26 Alexandre Petit-Bianco <apbianco@redhat.com> * parse.y (find_as_inner_class): Follow current package indications not to mistakingly load an unrelated class. (http://gcc.gnu.org/ml/gcc-patches/2001-03/msg01712.html) From-SVN: r40851
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 782a653..f42d763 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -3521,7 +3521,18 @@ find_as_inner_class (enclosing, name, cl)
acc = merge_qualified_name (acc,
EXPR_WFL_NODE (TREE_PURPOSE (qual)));
BUILD_PTR_FROM_NAME (ptr, acc);
- decl = do_resolve_class (NULL_TREE, ptr, NULL_TREE, cl);
+
+ /* Don't try to resolve ACC as a class name if it follows
+ the current package name. We don't want to pick something
+ that's accidentally there: for example `a.b.c' in package
+ `a.b' shouldn't trigger loading `a' if it's there by
+ itself. */
+ if (ctxp->package
+ && strstr (IDENTIFIER_POINTER (ctxp->package),
+ IDENTIFIER_POINTER (acc)))
+ decl = NULL;
+ else
+ decl = do_resolve_class (NULL_TREE, ptr, NULL_TREE, cl);
}
/* A NULL qual and a decl means that the search ended