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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sat Mar 2 10:42:03 PST 2013


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

Cheers,
Rafael



More information about the cfe-commits mailing list