[llvm-commits] [llvm] r145611 - /llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Kostya Serebryany kcc at google.com
Thu Dec 1 10:54:54 PST 2011


Author: kcc
Date: Thu Dec  1 12:54:53 2011
New Revision: 145611

URL: http://llvm.org/viewvc/llvm-project?rev=145611&view=rev
Log:
[asan] two minor fixes: use UnreachableInst after the neverreturn function call; use report_fatal_error when blacklist file can not be found

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=145611&r1=145610&r2=145611&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Thu Dec  1 12:54:53 2011
@@ -434,6 +434,7 @@
   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 @@
 
   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();





More information about the llvm-commits mailing list