genmatch.c (parser::parse_for): Reject iterator if used as operator-list.
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Sat, 23 May 2015 19:52:05 +0000 (19:52 +0000)
committerPrathamesh Kulkarni <prathamesh3492@gcc.gnu.org>
Sat, 23 May 2015 19:52:05 +0000 (19:52 +0000)
2015-05-23  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

* genmatch.c (parser::parse_for): Reject iterator if used as operator-list.

From-SVN: r223610

gcc/ChangeLog
gcc/genmatch.c

index b82d9464ccc6fe0c0b5166f962688e270f03ef18..1d18ffd92a9546c3b42a347d10ca712abcf66e8b 100644 (file)
@@ -1,3 +1,7 @@
+2015-05-20  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
+
+       * 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_operator_list): Check for CPP_CLOSE_PAREN after end of id-list.
index 4ea1cc9ee76e7cba08562d5b3322bf86fd14a04e..d1cf87215e0696cef1bc31ef11a29dbd38041cac 100644 (file)
@@ -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);
        }