[C PATCH] Don't ICE on invalid code (PR c/63549)

Jeff Law law@redhat.com
Thu Oct 16 22:35:00 GMT 2014


On 10/16/14 14:12, Marek Polacek wrote:
> We ICEd on this invalid testcase because build_array_ref was getting
> a decl with an incomplete type as an index, and default_conversion
> calls require_complete_type on it - and because it's not complete,
> it returns error_mark_node, and then we trip on an assert requiring
> it to be an integer type.
> Fixed by bailing out if default_conversion returns unusable expr.
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
>
> 2014-10-16  Marek Polacek  <polacek@redhat.com>
>
> 	PR c/63549
> 	* c-typeck.c (build_array_ref): Bail if the index in an incomplete
> 	type.
>
> 	* gcc.dg/pr63549.c: New test.
OK.
jeff



More information about the Gcc-patches mailing list