From: Evgeniy Stepanov Date: Wed, 20 Dec 2017 19:05:44 +0000 (+0000) Subject: [hwasan] Implement -fsanitize-recover=hwaddress. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56aba8eab88e79664e27f93a5917aa6eebbb9034;p=clang [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 --- diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 2c033e0f7c..e2349da5f0 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -239,7 +239,11 @@ static void addKernelAddressSanitizerPasses(const PassManagerBuilder &Builder, static void addHWAddressSanitizerPasses(const PassManagerBuilder &Builder, legacy::PassManagerBase &PM) { - PM.add(createHWAddressSanitizerPass()); + const PassManagerBuilderWrapper &BuilderWrapper = + static_cast(Builder); + const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts(); + bool Recover = CGOpts.SanitizeRecover.has(SanitizerKind::HWAddress); + PM.add(createHWAddressSanitizerPass(Recover)); } static void addMemorySanitizerPass(const PassManagerBuilder &Builder,