public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: java/4715 Date: Thu, 20 Dec 2001 22:46:00 -0000 [thread overview] Message-ID: <20011221064601.22564.qmail@sources.redhat.com> (raw) The following reply was made to PR java/4715; it has been noted by GNATS. From: Tom Tromey <tromey@redhat.com> To: Bryce McKinlay <bryce@waitaki.otago.ac.nz> 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 */
next reply other threads:[~2001-12-21 6:46 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-12-20 22:46 Tom Tromey [this message] 2002-03-28 15:46 java/4715 apbianco 2002-03-28 16:16 java/4715 apbianco
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20011221064601.22564.qmail@sources.redhat.com \ --to=tromey@redhat.com \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).