This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, PR67405, committed] Avoid NULL pointer dereference


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]