diff options
author | Andrew Haley <aph@redhat.com> | 2004-09-28 13:57:05 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2004-09-28 13:57:05 +0000 |
commit | 03ec093d0456c80c523f94189c53e89d321cc035 (patch) | |
tree | 57f5a35d1bfa1455e179a626e057eb58155b1c84 /gcc/java | |
parent | 38e05395acc76a5e8052abae6333c8a2ffb6008d (diff) | |
download | gcc-03ec093d0456c80c523f94189c53e89d321cc035.zip gcc-03ec093d0456c80c523f94189c53e89d321cc035.tar.gz gcc-03ec093d0456c80c523f94189c53e89d321cc035.tar.bz2 |
re PR java/17586 (kawa build fails with ICE)
2004-09-28 Andrew Haley <aph@redhat.com>
PR java/17586
* jcf-parse.c (load_class): Don't try to read a class that we've
already read.
Check that we really did read the right class.
From-SVN: r88233
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/java/jcf-parse.c | 20 |
2 files changed, 25 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 4b579bc..1ecd33f 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +2004-09-28 Andrew Haley <aph@redhat.com> + + PR java/17586 + * jcf-parse.c (load_class): Don't try to read a class that we've + already read. + Check that we really did read the right class. + 2004-09-25 Tom Tromey <tromey@redhat.com> PR java/17500: diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index bc733e8..f36cc95 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -566,7 +566,7 @@ void load_class (tree class_or_name, int verbose) { tree name, saved; - int class_loaded; + int class_loaded = 0; /* class_or_name can be the name of the class we want to load */ if (TREE_CODE (class_or_name) == IDENTIFIER_NODE) @@ -585,11 +585,20 @@ load_class (tree class_or_name, int verbose) } saved = name; + while (1) { char *separator; - if ((class_loaded = read_class (name))) + /* We've already loaded it. */ + if (IDENTIFIER_CLASS_VALUE (name) != NULL_TREE) + { + tree tmp_decl = IDENTIFIER_CLASS_VALUE (name); + if (CLASS_PARSED_P (TREE_TYPE (tmp_decl))) + break; + } + + if (read_class (name)) break; /* We failed loading name. Now consider that we might be looking @@ -607,6 +616,13 @@ load_class (tree class_or_name, int verbose) break; } + { + /* have we found the class we're looking for? */ + tree type_decl = IDENTIFIER_CLASS_VALUE (saved); + tree type = type_decl ? TREE_TYPE (type_decl) : NULL; + class_loaded = type && CLASS_PARSED_P (type); + } + if (!class_loaded && verbose) error ("cannot find file for class %s", IDENTIFIER_POINTER (saved)); } |