Enable addressable params sanitization with --param asan-stack=1.
authorMartin Liska <mliska@suse.cz>
Tue, 4 Jul 2017 10:53:18 +0000 (12:53 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Tue, 4 Jul 2017 10:53:18 +0000 (10:53 +0000)
2017-07-04  Martin Liska  <mliska@suse.cz>

PR sanitizer/81040
* sanopt.c (sanitize_rewrite_addressable_params): Mark the
newly created variable as DECL_IGNORED_P.
2017-07-04  Martin Liska  <mliska@suse.cz>

PR sanitizer/81040
* g++.dg/asan/function-argument-1.C: Run the test-case w/o
use-after-scope sanitization.

From-SVN: r249960

gcc/ChangeLog
gcc/sanopt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/asan/function-argument-1.C

index ee94e81496c127d771ba085ea3f74f47f7eba759..dda6ea47ea554ec4efdbd00b00d04a4a3a4baf7e 100644 (file)
@@ -1,3 +1,9 @@
+2017-07-04  Martin Liska  <mliska@suse.cz>
+
+       PR sanitizer/81040
+       * sanopt.c (sanitize_rewrite_addressable_params): Mark the
+       newly created variable as DECL_IGNORED_P.
+
 2017-07-04  Martin Liska  <mliska@suse.cz>
 
        PR ipa/81293
index 7692f6a9db716c793ed8423b5359a08cbced235c..b7740741d43a68d03ffa4f36f886c53c669f7305 100644 (file)
@@ -905,7 +905,7 @@ sanitize_rewrite_addressable_params (function *fun)
          tree var = build_decl (DECL_SOURCE_LOCATION (arg),
                                 VAR_DECL, DECL_NAME (arg), type);
          TREE_ADDRESSABLE (var) = 1;
-         DECL_ARTIFICIAL (var) = 1;
+         DECL_IGNORED_P (var) = 1;
 
          gimple_add_tmp_var (var);
 
index eb2bdad9966c739e951077955ed6d5bc3146d4dc..7a2e2ae3a6f6898616d0a9a5f36a564d8236cf58 100644 (file)
@@ -1,3 +1,9 @@
+2017-07-04  Martin Liska  <mliska@suse.cz>
+
+       PR sanitizer/81040
+       * g++.dg/asan/function-argument-1.C: Run the test-case w/o
+       use-after-scope sanitization.
+
 2017-07-04  Jakub Jelinek  <jakub@redhat.com>
 
        * g++.dg/asan/function-argument-3.C: Add -Wno-psabi to additional
index 148c4628316b86979dd212095c3f6e26c236bf29..bdbb37a44a4754ea289a5a75ae66a18629a507f4 100644 (file)
@@ -1,5 +1,6 @@
 // { dg-do run }
 // { dg-shouldfail "asan" }
+// { dg-options "-fsanitize=address -fno-sanitize-address-use-after-scope" }
 
 struct A
 {