From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22580 invoked by alias); 21 Dec 2001 06:46:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 22565 invoked by uid 71); 21 Dec 2001 06:46:01 -0000 Date: Thu, 20 Dec 2001 22:46:00 -0000 Message-ID: <20011221064601.22564.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Tom Tromey Subject: java/4715 Reply-To: Tom Tromey X-SW-Source: 2001-12/txt/msg01029.txt.bz2 List-Id: The following reply was made to PR java/4715; it has been noted by GNATS. From: Tom Tromey To: Bryce McKinlay Cc: gcc-gnats@gcc.gnu.org Subject: java/4715 Date: 20 Dec 2001 23:43:17 -0700 I looked at this PR a bit tonight. I didn't really get very far. This scenario seems too complex to figure out in one night (for me anyway). It wasn't clear to me that simply returning NULL_TREE when we encountered an incomplete type was correct. I came up with the appended patch, which seems to work. However, I don't vouch for its correctness. Tom Index: parse.y =================================================================== RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v retrieving revision 1.338 diff -u -r1.338 parse.y --- parse.y 2001/12/21 05:28:27 1.338 +++ parse.y 2001/12/21 06:29:48 @@ -5232,14 +5232,23 @@ 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 */