decl.c (reshape_init_class): Avoid dereferencing a past-the-end pointer.

* decl.c (reshape_init_class): Avoid dereferencing a
	past-the-end pointer.

From-SVN: r191106
This commit is contained in:
Mark Kettenis 2012-09-09 10:06:13 +00:00 committed by Gerald Pfeifer
parent bc1b72c78f
commit d5f8c6dc8c
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-09-09 Mark Kettenis <kettenis@openbsd.org>
* decl.c (reshape_init_class): Avoid dereferencing a
past-the-end pointer.
2012-09-07 Paolo Carlini <paolo.carlini@oracle.com>
* pt.c (num_template_headers_for_class): Rework per the code

View File

@ -5131,7 +5131,7 @@ reshape_init_class (tree type, reshape_iter *d, bool first_initializer_p,
if (field_init == error_mark_node)
return error_mark_node;
if (d->cur->index && d->cur == old_cur)
if (d->cur == old_cur && d->cur->index)
{
/* This can happen with an invalid initializer for a flexible
array member (c++/54441). */