diff options
author | Kostya Serebryany <kcc@google.com> | 2011-12-01 18:54:53 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2011-12-01 18:54:53 +0000 |
commit | cc1d856d8e8e11407b3c6c1d08768f77c3722e38 (patch) | |
tree | 14f0b4b7868dc6da4482a8ff1ae0106b3eea1b9c /lib/Transforms/Instrumentation | |
parent | fbd828d8e1133763c8acee540bcd221bc2aab355 (diff) | |
download | external_llvm-cc1d856d8e8e11407b3c6c1d08768f77c3722e38.zip external_llvm-cc1d856d8e8e11407b3c6c1d08768f77c3722e38.tar.gz external_llvm-cc1d856d8e8e11407b3c6c1d08768f77c3722e38.tar.bz2 |
[asan] two minor fixes: use UnreachableInst after the neverreturn function call; use report_fatal_error when blacklist file can not be found
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145611 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation')
-rw-r--r-- | lib/Transforms/Instrumentation/AddressSanitizer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp index b617539..83be31e 100644 --- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/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(); |