re PR sanitizer/59667 (ubsan: ICE ubsan_type_descriptor)
PR sanitizer/59667 * ubsan.c (ubsan_type_descriptor): Call strip_array_types on type2. testsuite/ * c-c++-common/ubsan/pr59667.c: New test. From-SVN: r206423
This commit is contained in:
parent
c15677b61c
commit
06636b3267
4 changed files with 28 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2014-01-08 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR sanitizer/59667
|
||||
* ubsan.c (ubsan_type_descriptor): Call strip_array_types on type2.
|
||||
|
||||
2014-01-08 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR rtl-optimization/59649
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2014-01-08 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR sanitizer/59667
|
||||
* c-c++-common/ubsan/pr59667.c: New test.
|
||||
|
||||
2014-01-08 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/59630
|
||||
|
|
15
gcc/testsuite/c-c++-common/ubsan/pr59667.c
Normal file
15
gcc/testsuite/c-c++-common/ubsan/pr59667.c
Normal file
|
@ -0,0 +1,15 @@
|
|||
/* { dg-do run } */
|
||||
/* { dg-options "-fsanitize=undefined" } */
|
||||
/* { dg-shouldfail "ubsan" } */
|
||||
/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
unsigned int len = 1;
|
||||
float (*P)[len][len] = 0;
|
||||
(*P)[0][0] = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* { dg-output "store to null pointer of type 'float'(\n|\r\n|\r)" } */
|
|
@ -311,6 +311,9 @@ ubsan_type_descriptor (tree type, bool want_pointer_type_p)
|
|||
type2 = TYPE_METHOD_BASETYPE (type2);
|
||||
}
|
||||
|
||||
/* If an array, get its type. */
|
||||
type2 = strip_array_types (type2);
|
||||
|
||||
if (TYPE_NAME (type2) != NULL)
|
||||
{
|
||||
if (TREE_CODE (TYPE_NAME (type2)) == IDENTIFIER_NODE)
|
||||
|
|
Loading…
Add table
Reference in a new issue