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: [C PATCH] Don't ICE on invalid code (PR c/63549)


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


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