Commit ce06965e by Alexandre Petit-Bianco Committed by Alexandre Petit-Bianco

parse.y (find_as_inner_class): Follow current package indications not to…

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
parent d38a30c9
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> 2001-03-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* constants.c (PUTN): Use memcpy, not bcopy. * constants.c (PUTN): Use memcpy, not bcopy.
......
...@@ -3521,7 +3521,18 @@ find_as_inner_class (enclosing, name, cl) ...@@ -3521,7 +3521,18 @@ find_as_inner_class (enclosing, name, cl)
acc = merge_qualified_name (acc, acc = merge_qualified_name (acc,
EXPR_WFL_NODE (TREE_PURPOSE (qual))); EXPR_WFL_NODE (TREE_PURPOSE (qual)));
BUILD_PTR_FROM_NAME (ptr, acc); 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 /* A NULL qual and a decl means that the search ended
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment