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 v2 05/17] Change increment_reading_symtab to return a scoped_restore


On 04/11/2017 04:01 PM, Tom Tromey wrote:
> -struct cleanup *
> +scoped_restore_tmpl<int>
>  increment_reading_symtab (void)
>  {
> -  ++currently_reading_symtab;
> +  return make_scoped_restore (&currently_reading_symtab,
> +			      currently_reading_symtab + 1);
>    gdb_assert (currently_reading_symtab > 0);
> -  return make_cleanup (decrement_reading_symtab, NULL);
>  }

I noticed that this makes the gdb_assert unreachable.

Thanks,
Pedro Alves


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