Re: [RFA v2 05/17] Change increment_reading_symtab to return a scoped_restore

Pedro Alves
2017-04-12T11:16:19Z

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