Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 56aba8e

Browse files
committed
[hwasan] Implement -fsanitize-recover=hwaddress.
Summary: Very similar to AddressSanitizer, with the exception of the error type encoding. Reviewers: kcc, alekseyshl Subscribers: cfe-commits, kubamracek, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D41417 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321203 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 6bb630e commit 56aba8e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/CodeGen/BackendUtil.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,11 @@ static void addKernelAddressSanitizerPasses(const PassManagerBuilder &Builder,
239239

240240
static void addHWAddressSanitizerPasses(const PassManagerBuilder &Builder,
241241
legacy::PassManagerBase &PM) {
242-
PM.add(createHWAddressSanitizerPass());
242+
const PassManagerBuilderWrapper &BuilderWrapper =
243+
static_cast<const PassManagerBuilderWrapper &>(Builder);
244+
const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts();
245+
bool Recover = CGOpts.SanitizeRecover.has(SanitizerKind::HWAddress);
246+
PM.add(createHWAddressSanitizerPass(Recover));
243247
}
244248

245249
static void addMemorySanitizerPass(const PassManagerBuilder &Builder,

0 commit comments

Comments
 (0)