aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@cygnus.com>2000-10-19 07:51:54 +0000
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2000-10-19 00:51:54 -0700
commit02ae6e2e4bdd2af6cd22372044124360152dfb72 (patch)
tree19ef220b02fc75ecf8472a6d3f89cfd6d0633415 /gcc
parentcc3f7b54c99342c8c8b22c8571c99cd982d25a7f (diff)
downloadgcc-02ae6e2e4bdd2af6cd22372044124360152dfb72.zip
gcc-02ae6e2e4bdd2af6cd22372044124360152dfb72.tar.gz
gcc-02ae6e2e4bdd2af6cd22372044124360152dfb72.tar.bz2
parse.y (process_imports): Consider that one might be trying to import an innerclass.
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 (http://gcc.gnu.org/ml/gcc-patches/2000-10/msg00631.html) From-SVN: r36948
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/parse.y27
2 files changed, 28 insertions, 4 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index ea73dc4..191b209 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -671,6 +671,11 @@ Sun Aug 6 00:47:24 2000 Ovidiu Predescu <ovidiu@cup.hp.com>
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
+
+2000-07-19 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
* parse.y (find_as_inner_class): Handle the case where the
enclosing context of an innerclass has been loaded as bytecode.
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index b3c2d87..1542624 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -6492,10 +6492,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),