summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2011-12-01 18:54:53 +0000
committerKostya Serebryany <kcc@google.com>2011-12-01 18:54:53 +0000
commitd594bac68b3b9d3c896c3c4fab1ac63060dafa16 (patch)
treedaed4e7dcc07c8d82294852ab8d2df9fb207616e /llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
parent6aec31a5cfa095a1ab8161b6c391fd8c0e476819 (diff)
downloadbcm5719-llvm-d594bac68b3b9d3c896c3c4fab1ac63060dafa16.tar.gz
bcm5719-llvm-d594bac68b3b9d3c896c3c4fab1ac63060dafa16.zip
[asan] two minor fixes: use UnreachableInst after the neverreturn function call; use report_fatal_error when blacklist file can not be found
llvm-svn: 145611
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index b6175396d36..83be31eada6 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -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();
OpenPOWER on IntegriCloud