Do not instrument static target_expr for use-after-scope (PR sanitizer/90570).
2019-05-23 Martin Liska <mliska@suse.cz> PR sanitizer/90570 * gimplify.c (gimplify_target_expr): Skip TREE_STATIC target expression similarly to gimplify_decl_expr. 2019-05-23 Martin Liska <mliska@suse.cz> PR sanitizer/90570 * g++.dg/asan/pr90570.C: New test. From-SVN: r271548
This commit is contained in:
parent
02b7331304
commit
832ece86e5
@ -1,3 +1,9 @@
|
||||
2019-05-23 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR sanitizer/90570
|
||||
* gimplify.c (gimplify_target_expr): Skip TREE_STATIC target
|
||||
expression similarly to gimplify_decl_expr.
|
||||
|
||||
2019-05-23 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
|
||||
|
||||
* cse.c (cse_dump_path): s/dump_file/f.
|
||||
|
@ -6668,6 +6668,7 @@ gimplify_target_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
|
||||
}
|
||||
if (asan_poisoned_variables
|
||||
&& DECL_ALIGN (temp) <= MAX_SUPPORTED_STACK_ALIGNMENT
|
||||
&& !TREE_STATIC (temp)
|
||||
&& dbg_cnt (asan_use_after_scope)
|
||||
&& !gimplify_omp_ctxp)
|
||||
{
|
||||
|
@ -1,3 +1,8 @@
|
||||
2019-05-23 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR sanitizer/90570
|
||||
* g++.dg/asan/pr90570.C: New test.
|
||||
|
||||
2019-05-23 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gnat.dg/opt78.ad[sb]: New test.
|
||||
|
18
gcc/testsuite/g++.dg/asan/pr90570.C
Normal file
18
gcc/testsuite/g++.dg/asan/pr90570.C
Normal file
@ -0,0 +1,18 @@
|
||||
/* PR sanitizer/90570 */
|
||||
/* { dg-do run } */
|
||||
|
||||
#include <vector>
|
||||
|
||||
struct stru
|
||||
{
|
||||
std::vector<int> v{1,2,3,4};
|
||||
int i{5};
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
stru s1;
|
||||
stru s2;
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user