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

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


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

>> libclang from the beginning has chosen to avoid crashing the process, see llvm::CrashRecoveryContext.
> 
> /// This class implements support for running operations in a safe context so
> /// that crashes (memory errors, stack overflow, assertion violations) can be
> /// detected and control restored to the crashing thread. Crash detection is
> /// purely "best effort", the exact set of failures which can be recovered from
> /// is platform dependent.
> 
> This looks like exactly what we need. Instead of doing
> 
> if (!foo) {
>  assert(0...);
> }
> 
> You can cause a "crash" and let the crash recovery mechanism handle it.

Doing that will still ignore the crash, but this time with a recovery mechanism that, while good intentioned (not bringing down the process) it's disruptive and should really not be triggered intentionally.

> 
> Cheers,
> Rafael





More information about the cfe-commits mailing list