This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/69517] [5/6 regression] SEGV on a VLA with excess initializer elements
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 13 Apr 2016 23:27:13 +0000
- Subject: [Bug c++/69517] [5/6 regression] SEGV on a VLA with excess initializer elements
- Auto-submitted: auto-generated
- References: <bug-69517-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69517
--- Comment #9 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Wed Apr 13 23:26:41 2016
New Revision: 234966
URL: https://gcc.gnu.org/viewcvs?rev=234966&root=gcc&view=rev
Log:
PR c++/69517 - [5/6 regression] SEGV on a VLA with excess initializer elements
PR c++/70019 - VLA size overflow not detected
PR c++/70588 - SIGBUS on a VLA larger than SIZE_MAX / 2
gcc/testsuite/ChangeLog:
2016-04-13 Martin Sebor <msebor@redhat.com>
PR c++/69517
PR c++/70019
PR c++/70588
* c-c++-common/ubsan/vla-1.c (main): Catch exceptions.
* g++.dg/cpp1y/vla11.C: New test.
* g++.dg/cpp1y/vla12.C: New test.
* g++.dg/cpp1y/vla13.C: New test.
* g++.dg/cpp1y/vla14.C: New test.
* g++.dg/cpp1y/vla3.C: Restore deleted test.
* gcc/testsuite/g++.dg/init/array24.C: Fully brace VLA initializer.
* g++.dg/ubsan/vla-1.C: Disable exceptions.
gcc/cp/ChangeLog:
2016-04-13 Martin Sebor <msebor@redhat.com>
PR c++/69517
PR c++/70019
PR c++/70588
* cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
functions.
* decl.c (check_initializer, cp_finish_decl): Call them.
(reshape_init_r): Reject incompletely braced intializer-lists
for VLAs.
* init.c (throw_bad_array_length, build_vla_check)
(build_vla_size_check, build_vla_init_check): Define new functions.
* typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
to detect a VLA.
(store_init_value): Same.
gcc/doc/ChangeLog:
2016-04-13 Martin Sebor <msebor@redhat.com>
PR c++/69517
PR c++/70019
PR c++/70588
* extend.texi (Variable Length): Document C++ specifics.
libstdc++-v3/ChangeLog:
2016-04-13 Martin Sebor <msebor@redhat.com>
PR c++/69517
* testsuite/25_algorithms/rotate/moveable2.cc: Make sure VLA
upper bound is positive.
Added:
trunk/gcc/testsuite/g++.dg/cpp1y/vla11.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla12.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla13.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla14.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla3.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/init.c
trunk/gcc/cp/typeck2.c
trunk/gcc/doc/extend.texi
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/c-c++-common/ubsan/vla-1.c
trunk/gcc/testsuite/g++.dg/init/array24.C
trunk/gcc/testsuite/g++.dg/ubsan/vla-1.C
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/testsuite/25_algorithms/rotate/moveable2.cc