This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR67405, committed] Avoid NULL pointer dereference
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 24 Sep 2015 16:18:10 +0200
- Subject: Re: [PATCH, PR67405, committed] Avoid NULL pointer dereference
- Authentication-results: sourceware.org; auth=none
- References: <20150901143909 dot GB55610 at msticlxl57 dot ims dot intel dot com> <CAFiYyc3kvXa2UN_j5Sdheyg7iLLb-zcaisSe2g8ZAh6eMiR9hw at mail dot gmail dot com> <CAMbmDYYQBK=mXnizUj_-xa_DgsdGspKYzUo=na3yDcPDXtRqgw at mail dot gmail dot com> <CAFiYyc2kWF+CuoXupEmc=9m=9HPq4NaL8UsCDV7EHD-J+=iZpA at mail dot gmail dot com> <CAMbmDYbQMVk7c_ri1Fag77m-gTFfmL7RTKJ2zgqD-j8=1yb3rA at mail dot gmail dot com> <CAFiYyc1=Wu4U=9RR_xb4dKPp9HXxJ3z3=AebJJFjW-s6hQXsDQ at mail dot gmail dot com> <CAMbmDYaDWjZoked4pp5KhGiypWGVWWmC3xNG7_=pmUdS79fkww at mail dot gmail dot com> <CAMbmDYbZoaL6DaXEwydxh92PfX2fktw9m-SsFFQsfhU9j-jQuA at mail dot gmail dot com>
On Thu, Sep 24, 2015 at 4:07 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
> 2015-09-15 14:01 GMT+03:00 Ilya Enkovich <enkovich.gnu@gmail.com>:
>> 2015-09-15 13:32 GMT+03:00 Richard Biener <richard.guenther@gmail.com>:
>>> On Tue, Sep 15, 2015 at 11:28 AM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>>>
>>> I see. I wonder why we even call chkp_find_bound_slots if seen_errors().
>>
>> Even with errors we still gimplify function. Function parameters
>> gimplification checks where parameters are passed to possibly copy
>> some of them. It triggers ix86_function_arg_advance which uses
>> chkp_find_bound_slots to skip required amount of bounds registers.
>>
>>> I suppose only recursing for COMPLETE_TYPE_P () would work?
>>
>> Yep, it should work. I'll rework my fix.
>
> It turned out to be wrong. For this test
>
> struct S
> {
> S f;
> };
>
> void fn1 (S p1) {}
>
> Structure S is considered as complete (has size 8 for some reason) at
> fn1 gimplification. Thus even with complete type check I still hit
> this field with error_node instead of a type and NULL at
> DECL_FIELD_BIT_OFFSET. Should my current fix be OK then?
What's the current fix again? The NULL check on DECL_FIELD_BIT_OFFSET?
I still don't like that. The frontend should leave us with something
easier here :/
And I wonder if we really need to gimplify when we've seen errors (yeah, we'll
get more diagnostics but also ICE-after-errors like this).
Richard.
> Thanks,
> Ilya
- References:
- [PATCH, PR67405, committed] Avoid NULL pointer dereference
- Re: [PATCH, PR67405, committed] Avoid NULL pointer dereference
- Re: [PATCH, PR67405, committed] Avoid NULL pointer dereference
- Re: [PATCH, PR67405, committed] Avoid NULL pointer dereference
- Re: [PATCH, PR67405, committed] Avoid NULL pointer dereference
- Re: [PATCH, PR67405, committed] Avoid NULL pointer dereference
- Re: [PATCH, PR67405, committed] Avoid NULL pointer dereference
- Re: [PATCH, PR67405, committed] Avoid NULL pointer dereference