genmatch.c (parser::parse_operator_list): Check for CPP_CLOSE_PAREN after end of...
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Sat, 23 May 2015 19:36:32 +0000 (19:36 +0000)
committerPrathamesh Kulkarni <prathamesh3492@gcc.gnu.org>
Sat, 23 May 2015 19:36:32 +0000 (19:36 +0000)
2015-05-19  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

* genmatch.c (parser::parse_operator_list): Check for CPP_CLOSE_PAREN after end of id-list.

From-SVN: r223609

gcc/ChangeLog
gcc/genmatch.c

index 92bb91e44c4d9d8a8e399cde185dcd21fb72af52..b82d9464ccc6fe0c0b5166f962688e270f03ef18 100644 (file)
@@ -1,3 +1,7 @@
+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.
+
 2015-05-22  Jan Hubicka  <hubicka@ucw.cz>
 
        * tree.c (gimple_canonical_types_compatible_p): Sanity check that
index bca79092455ec73018ecbd0ff44d396bff79e687..4ea1cc9ee76e7cba08562d5b3322bf86fd14a04e 100644 (file)
@@ -3427,6 +3427,11 @@ parser::parse_operator_list (source_location)
        op->substitutes.safe_push (idb);
     }
 
+  // Check that there is no junk after id-list
+  token = peek();
+  if (token->type != CPP_CLOSE_PAREN)
+    fatal_at (token, "expected identifier got %s", cpp_type2name (token->type, 0));
+
   if (op->substitutes.length () == 0)
     fatal_at (token, "operator-list cannot be empty");