[asan] two minor fixes: use UnreachableInst after the neverreturn function call;...
authorKostya Serebryany <kcc@google.com>
Thu, 1 Dec 2011 18:54:53 +0000 (18:54 +0000)
committerKostya Serebryany <kcc@google.com>
Thu, 1 Dec 2011 18:54:53 +0000 (18:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145611 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/AddressSanitizer.cpp

index b6175396d36099742e90a5d07ab14b2b31b92104..83be31eada626c88f568808822b5efd1bff0ad3f 100644 (file)
@@ -434,6 +434,7 @@ void AddressSanitizer::instrumentAddress(Instruction *OrigIns,
   IRBuilder<> IRB1(CheckTerm);
   Instruction *Crash = generateCrashCode(IRB1, AddrLong, IsWrite, TypeSize);
   Crash->setDebugLoc(OrigIns->getDebugLoc());
+  ReplaceInstWithInst(CheckTerm, new UnreachableInst(*C));
 }
 
 // This function replaces all global variables with new variables that have
@@ -951,8 +952,8 @@ BlackList::BlackList(const std::string &Path) {
 
   OwningPtr<MemoryBuffer> File;
   if (error_code EC = MemoryBuffer::getFile(ClBlackListFile.c_str(), File)) {
-    errs() << EC.message();
-    exit(1);
+    report_fatal_error("Can't open blacklist file " + ClBlackListFile + ": " +
+                       EC.message());
   }
   MemoryBuffer *Buff = File.take();
   const char *Data = Buff->getBufferStart();