[PATCH, PR67405, committed] Avoid NULL pointer dereference

Ilya Enkovich enkovich.gnu@gmail.com
Tue Sep 15 11:10:00 GMT 2015

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:
>> 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().

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.


> Richard.

More information about the Gcc-patches mailing list