aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2016-11-16 12:56:58 +0100
committerMartin Liska <marxin@gcc.gnu.org>2016-11-16 11:56:58 +0000
commit080140bc85bd8b5be9634beb8cbc2f0324e1d649 (patch)
treeb4578276aa988216a737becffed8c4f02ae81ddd /gcc/gimplify.c
parent3e077364f3f6aa74bc662d5c2f16264dd622a4a9 (diff)
downloadgcc-080140bc85bd8b5be9634beb8cbc2f0324e1d649.zip
gcc-080140bc85bd8b5be9634beb8cbc2f0324e1d649.tar.gz
gcc-080140bc85bd8b5be9634beb8cbc2f0324e1d649.tar.bz2
Fix PR sanitizer/78270 (part 2)
PR sanitizer/78270 * gimplify.c (gimplify_switch_expr): Always save previous gimplify_ctxp->live_switch_vars. PR sanitizer/78270 * gcc.dg/asan/pr78270.c: Update comment style. * gcc.dg/asan/pr78270-2.c: New test. From-SVN: r242485
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 16573dd..c23888b 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -2255,11 +2255,11 @@ gimplify_switch_expr (tree *expr_p, gimple_seq *pre_p)
gimplify_ctxp->case_labels.create (8);
/* Do not create live_switch_vars if SWITCH_BODY is not a BIND_EXPR. */
+ saved_live_switch_vars = gimplify_ctxp->live_switch_vars;
if (TREE_CODE (SWITCH_BODY (switch_expr)) == BIND_EXPR)
- {
- saved_live_switch_vars = gimplify_ctxp->live_switch_vars;
- gimplify_ctxp->live_switch_vars = new hash_set<tree> (4);
- }
+ gimplify_ctxp->live_switch_vars = new hash_set<tree> (4);
+ else
+ gimplify_ctxp->live_switch_vars = NULL;
bool old_in_switch_expr = gimplify_ctxp->in_switch_expr;
gimplify_ctxp->in_switch_expr = true;