re PR c/70852 (ice in warn_for_memset)
PR c/70852 * c-common.c (warn_for_memset): Check domain before accessing it. * gcc.dg/pr70852.c: New test. From-SVN: r235638
This commit is contained in:
parent
500ecf4abd
commit
2fff3db89f
@ -1,3 +1,8 @@
|
||||
2016-04-29 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c/70852
|
||||
* c-common.c (warn_for_memset): Check domain before accessing it.
|
||||
|
||||
2016-04-29 Dominik Vogt <vogt@linux.vnet.ibm.com>
|
||||
|
||||
PR/69089
|
||||
|
@ -11796,6 +11796,7 @@ warn_for_memset (location_t loc, tree arg0, tree arg2,
|
||||
tree elt_type = TREE_TYPE (type);
|
||||
tree domain = TYPE_DOMAIN (type);
|
||||
if (!integer_onep (TYPE_SIZE_UNIT (elt_type))
|
||||
&& domain != NULL_TREE
|
||||
&& TYPE_MAXVAL (domain)
|
||||
&& TYPE_MINVAL (domain)
|
||||
&& integer_zerop (TYPE_MINVAL (domain))
|
||||
|
@ -3,6 +3,9 @@
|
||||
PR sanitizer/70342
|
||||
* g++.dg/ubsan/null-7.C: New test.
|
||||
|
||||
PR c/70852
|
||||
* gcc.dg/pr70852.c: New test.
|
||||
|
||||
2016-04-29 Dominik Vogt <vogt@linux.vnet.ibm.com>
|
||||
|
||||
PR/69089
|
||||
|
11
gcc/testsuite/gcc.dg/pr70852.c
Normal file
11
gcc/testsuite/gcc.dg/pr70852.c
Normal file
@ -0,0 +1,11 @@
|
||||
/* PR c/70852 */
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Wall" } */
|
||||
|
||||
extern void *memset (void *, int, __SIZE_TYPE__);
|
||||
extern int A[];
|
||||
void
|
||||
fn1 (void)
|
||||
{
|
||||
memset (A, 0, 1);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user