aboutsummaryrefslogtreecommitdiff
path: root/gcc/genmatch.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-10-05 11:58:25 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-10-05 11:58:25 +0000
commit496326bcc14616ae90da47db7a7f203d79f02923 (patch)
tree398d851c0a5429f4aa70307773b6ad100313b73e /gcc/genmatch.c
parent39bb7d015297586294c6416a4db78b50345d2a46 (diff)
downloadgcc-496326bcc14616ae90da47db7a7f203d79f02923.zip
gcc-496326bcc14616ae90da47db7a7f203d79f02923.tar.gz
gcc-496326bcc14616ae90da47db7a7f203d79f02923.tar.bz2
re PR middle-end/77863 (genmatch segfault on a wrong usage of an for operator)
2016-10-05 Richard Biener <rguenther@suse.de> PR middle-end/77863 * genmatch.c (capture_info::walk_c_expr): Diagnose unknown capture ids in c-exprs. From-SVN: r240777
Diffstat (limited to 'gcc/genmatch.c')
-rw-r--r--gcc/genmatch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index 5883ba3..de03d34 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -2194,8 +2194,10 @@ capture_info::walk_c_expr (c_expr *e)
id = (const char *)n->val.str.text;
else
id = (const char *)CPP_HASHNODE (n->val.node.node)->ident.str;
- unsigned where = *e->capture_ids->get(id);
- info[info[where].same_as].force_no_side_effects_p = true;
+ unsigned *where = e->capture_ids->get(id);
+ if (! where)
+ fatal_at (n, "unknown capture id '%s'", id);
+ info[info[*where].same_as].force_no_side_effects_p = true;
if (verbose >= 1
&& !gimple)
warning_at (t, "capture escapes");