public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Ilya Enkovich <enkovich.gnu@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH, PR67405, committed] Avoid NULL pointer dereference
Date: Tue, 15 Sep 2015 10:34:00 -0000	[thread overview]
Message-ID: <CAFiYyc1=Wu4U=9RR_xb4dKPp9HXxJ3z3=AebJJFjW-s6hQXsDQ@mail.gmail.com> (raw)
In-Reply-To: <CAMbmDYbQMVk7c_ri1Fag77m-gTFfmL7RTKJ2zgqD-j8=1yb3rA@mail.gmail.com>

On Tue, Sep 15, 2015 at 11:28 AM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
> 2015-09-13 16:36 GMT+03:00 Richard Biener <richard.guenther@gmail.com>:
>> On Mon, Sep 7, 2015 at 2:39 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>>> 2015-09-02 15:35 GMT+03:00 Richard Biener <richard.guenther@gmail.com>:
>>>>
>>>> DECL_FIELD_BIT_OFFSET should be never NULL.  Whoever created that
>>>> FIELD_DECL created an invalid one.
>>>>
>>>> Richard.
>>>>
>>>
>>> layout_class_type doesn't place fields with no type
>>
>> Err - that's because fields should also have a type.
>
> Sure. But we are talking about a wrong code and still want to continue
> compilation to some point even if some field misses a type. It means
> everything possibly invoked at this stage should check type against
> error_mark_node. Thus I need to handle it gracefully in
> chkp_find_bound_slots I suppose.

I see.  I wonder why we even call chkp_find_bound_slots if seen_errors().
I suppose only recursing for COMPLETE_TYPE_P () would work?

Richard.

> Ilya
>
>>
>>> and thus we have
>>> nothing for DECL_FIELD_BIT_OFFSET. We still continue compilation and
>>> function parameters gimplification causes a call to
>>> chkp_find_bound_slots_1 which tries to access. So probably I should
>>> handle gracefully fields with error_mark_node as a type? Or we better
>>> put something into DECL_FIELD_BIT_OFFSET (zero? error_mark_node?) for
>>> such fields.
>>>
>>> Ilya

  reply	other threads:[~2015-09-15 10:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 15:04 Ilya Enkovich
2015-09-02 12:35 ` Richard Biener
2015-09-02 12:51   ` Ilya Enkovich
2015-09-02 13:25     ` Richard Biener
2015-09-07 12:48   ` Ilya Enkovich
2015-09-13 14:46     ` Richard Biener
2015-09-15  9:30       ` Ilya Enkovich
2015-09-15 10:34         ` Richard Biener [this message]
2015-09-15 11:10           ` Ilya Enkovich
2015-09-24 15:13             ` Ilya Enkovich
2015-09-24 15:18               ` Richard Biener

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='CAFiYyc1=Wu4U=9RR_xb4dKPp9HXxJ3z3=AebJJFjW-s6hQXsDQ@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=enkovich.gnu@gmail.com \
    --cc=gcc-patches@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: link
Be 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).