This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[match-and-simplify] fix segfault in parser::parse_for


genmatch segfaults if user-defined operator is not specified.

eg:
(for (oper1 oper2...)
  pattern)

* genmatch.c
  (parser::parse_for): Call peek instead of peek_ident.

Thanks,
Prathamesh
Index: genmatch.c
===================================================================
--- genmatch.c	(revision 216826)
+++ genmatch.c	(working copy)
@@ -2953,8 +2953,8 @@
 
   while (1)
     {
-      token = peek_ident ();
-      if (token == 0)
+      token = peek ();
+      if (token->type != CPP_NAME)
 	break;
 
       /* Insert the user defined operators into the operator hash.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]