diff options
author | Martin Sebor <msebor@redhat.com> | 2016-04-13 23:26:41 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2016-04-13 17:26:41 -0600 |
commit | 342fac9537c6a75e65fe62943ba84b81bddede3f (patch) | |
tree | 1d55385c5ee07d32a08d9279dcb595632d96e73c /gcc/cp/cp-tree.h | |
parent | 2ecc0c837bf2ac1309f41d30b7b30595331a6eb6 (diff) | |
download | gcc-342fac9537c6a75e65fe62943ba84b81bddede3f.zip gcc-342fac9537c6a75e65fe62943ba84b81bddede3f.tar.gz gcc-342fac9537c6a75e65fe62943ba84b81bddede3f.tar.bz2 |
PR c++/69517 - [5/6 regression] SEGV on a VLA with excess initializer elements
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.
From-SVN: r234966
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 8d721c7..87e3ea0 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -5950,6 +5950,7 @@ extern tree build_value_init_noctor (tree, tsubst_flags_t); extern tree get_nsdmi (tree, bool); extern tree build_offset_ref (tree, tree, bool, tsubst_flags_t); +extern tree throw_bad_array_length (void); extern tree throw_bad_array_new_length (void); extern tree build_new (vec<tree, va_gc> **, tree, tree, vec<tree, va_gc> **, int, @@ -5971,6 +5972,7 @@ extern tree scalar_constant_value (tree); extern tree decl_really_constant_value (tree); extern int diagnose_uninitialized_cst_or_ref_member (tree, bool, bool); extern tree build_vtbl_address (tree); +extern tree build_vla_check (tree, tree = NULL_TREE); /* in lex.c */ extern void cxx_dup_lang_specific_decl (tree); |