Re: [RFA 05/13] Remove directive-searched cleanups

Simon Marchi
2017-11-03T16:46:35Z

On 2017-11-03 12:42, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
>
>>> if (*excludep)
>>> - {
>>> - discard_cleanups (searched_cleanup);
>>> - continue;
>>> - }
>>> + continue;
>
> Simon> In this case, the cleanup is discarded. Shouldn't the same
> thing
> Simon> happen with the scoped_restore? Or was it an error in the
> original
> Simon> code, and we always want to reset searched?
>
> Simon> There's the same case in d-namespace.c.
>
> I'm afraid I hadn't noticed this. Ouch.
>
> However, I think it has to be a latent bug, because it will result in
> the using_direct's searched flag being permanently set -- nothing else
> will ever clear it.
>
> Tom

That's what my assumption was. From what I understand, we want to set
the flag while we recurse and always restore it when we return.

Simon