diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-08-12 18:04:33 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-08-12 18:04:33 +0200 |
commit | 2f1364c2b325eec008bf461a0d77264618a9afe8 (patch) | |
tree | 2e00735b63167cdb3d3b63e5b6d1ae320e43c34a /gcc/testsuite/gcc.dg | |
parent | d186f41d35f7dd1190bf175b9224fa6f941ffbc0 (diff) | |
download | gcc-2f1364c2b325eec008bf461a0d77264618a9afe8.zip gcc-2f1364c2b325eec008bf461a0d77264618a9afe8.tar.gz gcc-2f1364c2b325eec008bf461a0d77264618a9afe8.tar.bz2 |
re PR c/67410 (c/c-typeck.c references out of bounds array)
PR c/67410
* c-typeck.c (set_nonincremental_init_from_string): Use / instead of
% to determine val element to change. Assert that
wchar_bytes * charwidth fits into val array.
* gcc.dg/pr67410.c: New test.
Co-Authored-By: Martin Liska <mliska@suse.cz>
From-SVN: r239419
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr67410.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr67410.c b/gcc/testsuite/gcc.dg/pr67410.c new file mode 100644 index 0000000..ff3c4f1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr67410.c @@ -0,0 +1,15 @@ +/* PR c/67410 */ +/* { dg-do run } */ +/* { dg-options "-std=gnu11" } */ + +struct { + __CHAR16_TYPE__ s[2]; +} a[] = { u"ff", [0].s[0] = u'x', [1] = u"\u1234\u4567", [1].s[0] = u'\u89ab' }; + +int +main () +{ + if (a[0].s[0] != u'x' || a[0].s[1] != u'f' || a[1].s[0] != u'\u89ab' || a[1].s[1] != u'\u4567') + __builtin_abort (); + return 0; +} |