aboutsummaryrefslogtreecommitdiff
path: root/gcc/genmatch.c
diff options
context:
space:
mode:
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>2015-05-23 19:52:05 +0000
committerPrathamesh Kulkarni <prathamesh3492@gcc.gnu.org>2015-05-23 19:52:05 +0000
commit7523ca9b70f478b6322c98ed33056f2c7a71b17c (patch)
tree6e685d9a9f5866a367f8da52014214d031858d00 /gcc/genmatch.c
parentb78be01498988d08713eaaf3c28c568d33e33db3 (diff)
downloadgcc-7523ca9b70f478b6322c98ed33056f2c7a71b17c.zip
gcc-7523ca9b70f478b6322c98ed33056f2c7a71b17c.tar.gz
gcc-7523ca9b70f478b6322c98ed33056f2c7a71b17c.tar.bz2
genmatch.c (parser::parse_for): Reject iterator if used as operator-list.
2015-05-23 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * genmatch.c (parser::parse_for): Reject iterator if used as operator-list. From-SVN: r223610
Diffstat (limited to 'gcc/genmatch.c')
-rw-r--r--gcc/genmatch.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/genmatch.c b/gcc/genmatch.c
index 4ea1cc9..d1cf872 100644
--- a/gcc/genmatch.c
+++ b/gcc/genmatch.c
@@ -3329,8 +3329,13 @@ parser::parse_for (source_location)
"others with arity %d", oper, idb->nargs, arity);
user_id *p = dyn_cast<user_id *> (idb);
- if (p && p->is_oper_list)
- op->substitutes.safe_splice (p->substitutes);
+ if (p)
+ {
+ if (p->is_oper_list)
+ op->substitutes.safe_splice (p->substitutes);
+ else
+ fatal_at (token, "iterator cannot be used as operator-list");
+ }
else
op->substitutes.safe_push (idb);
}