summaryrefslogtreecommitdiff
path: root/gcc/genmatch.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-05 11:58:25 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-05 11:58:25 +0000
commit2df1faeaf251ba3639dd33ac7cc512e6f2f1b8e5 (patch)
tree398d851c0a5429f4aa70307773b6ad100313b73e /gcc/genmatch.c
parentbf1426ea170b77b52efb471bcc62db4cc923d594 (diff)
downloadgcc-2df1faeaf251ba3639dd33ac7cc512e6f2f1b8e5.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240777 138bc75d-0d04-0410-961f-82ee72b054a4
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 5883ba39420..de03d34a6b3 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");