Do not handle VLA in sanitization (PR sanitizer/81460).
2017-07-28 Martin Liska <mliska@suse.cz> PR sanitizer/81460 * sanopt.c (sanitize_rewrite_addressable_params): Do not rewrite parameters that are of a variable-length. 2017-07-28 Martin Liska <mliska@suse.cz> PR sanitizer/81460 * gcc.dg/asan/pr81460.c: New test. From-SVN: r250655
This commit is contained in:
parent
16bab95a79
commit
70affe6aff
4 changed files with 22 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2017-07-28 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR sanitizer/81460
|
||||
* sanopt.c (sanitize_rewrite_addressable_params): Do not rewrite
|
||||
parameters that are of a variable-length.
|
||||
|
||||
2017-07-28 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||
|
||||
* config.gcc (powerpc-*-rtems*): Remove rs6000/eabi.h. Add
|
||||
|
|
|
@ -894,11 +894,12 @@ sanitize_rewrite_addressable_params (function *fun)
|
|||
for (tree arg = DECL_ARGUMENTS (current_function_decl);
|
||||
arg; arg = DECL_CHAIN (arg))
|
||||
{
|
||||
if (TREE_ADDRESSABLE (arg) && !TREE_ADDRESSABLE (TREE_TYPE (arg)))
|
||||
tree type = TREE_TYPE (arg);
|
||||
if (TREE_ADDRESSABLE (arg) && !TREE_ADDRESSABLE (type)
|
||||
&& TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST)
|
||||
{
|
||||
TREE_ADDRESSABLE (arg) = 0;
|
||||
/* The parameter is no longer addressable. */
|
||||
tree type = TREE_TYPE (arg);
|
||||
has_any_addressable_param = true;
|
||||
|
||||
/* Create a new automatic variable. */
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2017-07-28 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR sanitizer/81460
|
||||
* gcc.dg/asan/pr81460.c: New test.
|
||||
|
||||
2017-07-28 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/81578
|
||||
|
|
8
gcc/testsuite/gcc.dg/asan/pr81460.c
Normal file
8
gcc/testsuite/gcc.dg/asan/pr81460.c
Normal file
|
@ -0,0 +1,8 @@
|
|||
/* PR sanitizer/80460 */
|
||||
/* { dg-do compile } */
|
||||
|
||||
int
|
||||
f (int a, struct { int b[a]; } c) /* { dg-warning "anonymous struct declared inside parameter list will not be visible outside of this definition or declaration" } */
|
||||
{
|
||||
return c.b[0];
|
||||
}
|
Loading…
Add table
Reference in a new issue