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]

Re: [gimplefe] reject invalid pass name in startwith


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


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