This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[match-and-simplify] fix segfault in parser::parse_for
- From: Prathamesh Kulkarni <bilbotheelffriend at gmail dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 29 Oct 2014 18:31:18 +0530
- Subject: [match-and-simplify] fix segfault in parser::parse_for
- Authentication-results: sourceware.org; auth=none
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. */