+2017-01-05 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/78815
+ * gimplify.c (gimplify_decl_expr): Compare to
+ asan_poisoned_variables instread of checking flags.
+ (gimplify_target_expr): Likewise.
+ (gimplify_expr): Likewise.
+ (gimplify_function_tree): Conditionally initialize
+ asan_poisoned_variables.
+
2017-01-04 Jeff Law <law@redhat.com>
PR tree-optimizatin/78812
is_vla = true;
}
- if (asan_sanitize_use_after_scope ()
- && !asan_no_sanitize_address_p ()
+ if (asan_poisoned_variables
&& !is_vla
&& TREE_ADDRESSABLE (decl)
&& !TREE_STATIC (decl)
else
cleanup = clobber;
}
- if (asan_sanitize_use_after_scope ()
- && dbg_cnt (asan_use_after_scope))
+ if (asan_poisoned_variables && dbg_cnt (asan_use_after_scope))
{
tree asan_cleanup = build_asan_poison_call_expr (temp);
if (asan_cleanup)
/* If the label is used in a goto statement, or address of the label
is taken, we need to unpoison all variables that were seen so far.
Doing so would prevent us from reporting a false positives. */
- if (asan_sanitize_use_after_scope ()
+ if (asan_poisoned_variables
&& asan_used_labels != NULL
&& asan_used_labels->contains (label))
asan_poison_variables (asan_poisoned_variables, false, pre_p);
&& !needs_to_live_in_memory (ret))
DECL_GIMPLE_REG_P (ret) = 1;
- asan_poisoned_variables = new hash_set<tree> ();
+ if (asan_sanitize_use_after_scope () && !asan_no_sanitize_address_p ())
+ asan_poisoned_variables = new hash_set<tree> ();
bind = gimplify_body (fndecl, true);
- delete asan_poisoned_variables;
- asan_poisoned_variables = NULL;
+ if (asan_poisoned_variables)
+ {
+ delete asan_poisoned_variables;
+ asan_poisoned_variables = NULL;
+ }
/* The tree body of the function is no longer needed, replace it
with the new GIMPLE body. */