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

Argyrios Kyrtzidis akyrtzi at gmail.com
Sat Mar 2 10:25:25 PST 2013


On Mar 2, 2013, at 5:40 AM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:

>> 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?

libclang from the beginning has chosen to avoid crashing the process, see llvm::CrashRecoveryContext.

> 
> Cheers,
> Rafael





More information about the cfe-commits mailing list