This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Java: Fix to gcj/254
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] Java: Fix to gcj/254
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: Thu, 19 Oct 2000 00:49:03 -0700
- Reply-to: apbianco at redhat dot com
This patch fixes gcj/254. I'm checking it in:
http://sources.redhat.com/ml/java-prs/2000-q2/msg00286.html
./A
2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (process_imports): Consider that one might be trying to
import an innerclass. Fixes gcj/254
Index: parse.y
===================================================================
diff -u -p parse.y
--- old-/home/apbianco/src/egcs/gcc/.java-ref/parse.y Wed Jul 19 12:40:25 2000
+++ parse.y Wed Jul 19 18:57:31 2000
@@ -6401,10 +6412,29 @@ process_imports ()
/* Don't load twice something already defined. */
if (IDENTIFIER_CLASS_VALUE (to_be_found))
continue;
- QUALIFIED_P (to_be_found) = 1;
- load_class (to_be_found, 0);
- error_found =
- check_pkg_class_access (to_be_found, TREE_PURPOSE (import));
+
+ while (1)
+ {
+ tree left;
+
+ QUALIFIED_P (to_be_found) = 1;
+ load_class (to_be_found, 0);
+ error_found =
+ check_pkg_class_access (to_be_found, TREE_PURPOSE (import));
+
+ /* We found it, we can bail out */
+ if (IDENTIFIER_CLASS_VALUE (to_be_found))
+ break;
+
+ /* We haven't found it. Maybe we're trying to access an
+ inner class. The only way for us to know is to try again
+ after having dropped a qualifier. If we can't break it further,
+ we have an error. */
+ if (breakdown_qualified (&left, NULL, to_be_found))
+ break;
+
+ to_be_found = left;
+ }
if (!IDENTIFIER_CLASS_VALUE (to_be_found))
{
parse_error_context (TREE_PURPOSE (import),