This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gimplefe] reject invalid pass name in startwith
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Prathamesh Kulkarni <prathamesh dot kulkarni at linaro dot org>
- Cc: gcc Patches <gcc-patches at gcc dot gnu dot org>, Richard Biener <rguenther at suse dot de>
- Date: Sun, 18 Dec 2016 13:32:28 +0100
- Subject: Re: [gimplefe] reject invalid pass name in startwith
- Authentication-results: sourceware.org; auth=none
- References: <CAAgBjMmCk7aBysr4726ypVbntVabBSoseSTD06026cw+9_f-aA@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sun, Dec 18, 2016 at 05:41:23PM +0530, Prathamesh Kulkarni wrote:
> --- a/gcc/c/gimple-parser.c
> +++ b/gcc/c/gimple-parser.c
> @@ -1046,6 +1046,17 @@ c_parser_gimple_pass_list (c_parser *parser)
> if (! c_parser_require (parser, CPP_CLOSE_PAREN, "expected %<)%>"))
> return NULL;
>
> + if (pass)
> + {
> + char *full_passname = (char *) xmalloc (strlen ("tree-") + strlen (pass) + 1);
> + strcpy (full_passname, "tree-");
> + strcat (full_passname, pass);
Use
char *full_passname = concat ("tree-", pass, NULL);
instead?
Jakub