r176333 - Add one more sanity check in SourceManager::getFileIDLoaded().

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sat Mar 2 05:40:40 PST 2013


> I'm concerned that this kind of development approach doesn't actually
> make code more robust if we're designing the program to continue down
> other untested code paths (OK - so it doesn't infloop here, it does
> something else unexpected later). Are clients of this API intending to
> account for invalid FileIDs being returned, for example.

Having worked on a codebase that went down this path a long time ago I
must second this concern. Changes like this make bug easier to ignore,
and the result is just that, they are ignored.

In other codebases what I have seen is a assert-like macro that causes
crashes on non debug builds too. That makes bugs easier to reproduce
and much harder to ignore. Could we do something like that in here?

Cheers,
Rafael



More information about the cfe-commits mailing list