This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [RFA 1/4] Remove make_cleanup_clear_parser_state


On 09/06/2017 06:13 AM, Tom Tromey wrote:

>  f_parse (struct parser_state *par_state)
>  {
>    int result;
> -  struct cleanup *c = make_cleanup_clear_parser_state (&pstate);
>  
>    /* Setting up the parser state.  */
> +  scoped_restore pstate_restore = make_scoped_restore (&pstate);
>    gdb_assert (par_state != NULL);
>    pstate = par_state;
>  
>    result = yyparse ();
> -  do_cleanups (c);
>    return result;

You could remove "result" here too.

Otherwise looks fine to me, thanks!

Pedro Alves


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