aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/java/parse.y15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 7c50c97..b3f383c 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -5232,14 +5232,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 are compiling multiple files at once. 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 */