summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-26 22:12:16 +0000
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-26 22:12:16 +0000
commitc3037e20b8ea0e6482bf6ada4213c4b52b6bed3d (patch)
tree602715cc2492a4adc66e18cf92b70ba5933853fe
parent03642f48c4c89a8b10480d3b59f453dcf4da9ac7 (diff)
downloadgcc-c3037e20b8ea0e6482bf6ada4213c4b52b6bed3d.tar.gz
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) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40851 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/parse.y13
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index a7ffcea9abd..d1471544b7f 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2001-03-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* constants.c (PUTN): Use memcpy, not bcopy.
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 782a6536504..f42d76399de 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