summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-29 21:58:49 +0000
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-29 21:58:49 +0000
commit65ea9839d82ae36bd69203ce51d399df81e02e2f (patch)
tree94e55504d59895bde52c7317e9f1e8b303f7cda0 /gcc
parent71f90aa459f1c45c383c2eb0d97053be642f5c90 (diff)
downloadgcc-65ea9839d82ae36bd69203ce51d399df81e02e2f.tar.gz
2002-03-29 Tom Tromey <tromey@redhat.com>
* parse.y (check_inner_circular_reference): Ignore incomplete types. (http://gcc.gnu.org/ml/gcc-patches/2002-03/msg01987.html) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51573 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/parse.y15
2 files changed, 17 insertions, 3 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index b4ffd1988e3..5adea4c8216 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2002-03-29 Tom Tromey <tromey@redhat.com>
+
+ * parse.y (check_inner_circular_reference): Ignore incomplete
+ types.
+
2002-03-29 Neil Booth <neil@daikokuya.demon.co.uk>
* Make-lang.in (builtins.o): Update.
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 5bfcbd0509b..6dccb3b23e3 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -5245,14 +5245,23 @@ check_inner_circular_reference (source, target)
if (!basetype_vec)
return NULL_TREE;
-
+
for (i = 0; i < TREE_VEC_LENGTH (basetype_vec); i++)
{
- tree su = BINFO_TYPE (TREE_VEC_ELT (basetype_vec, i));
+ tree su;
+
+ /* We can end up with a NULL_TREE or an incomplete type here if
+ we encountered previous type resolution errors. It's safe to
+ simply ignore these cases. */
+ if (TREE_VEC_ELT (basetype_vec, i) == NULL_TREE)
+ continue;
+ su = BINFO_TYPE (TREE_VEC_ELT (basetype_vec, i));
+ if (INCOMPLETE_TYPE_P (su))
+ continue;
if (inherits_from_p (su, target))
return lookup_cl (TYPE_NAME (su));
-
+
for (ctx = DECL_CONTEXT (TYPE_NAME (su)); ctx; ctx = DECL_CONTEXT (ctx))
{
/* An enclosing context shouldn't be TARGET */