From: Evgeniy Stepanov Date: Mon, 7 Nov 2016 21:02:11 +0000 (+0000) Subject: Use -fsanitize-recover instead of -mllvm -msan-keep-going: clang. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8128dec2e7c41298e4ba63aef7a695409a710827;p=clang Use -fsanitize-recover instead of -mllvm -msan-keep-going: clang. Summary: Use -fsanitize-recover instead of -mllvm -msan-keep-going: pass -fsanitize-recover value to msan. Reviewers: eugenis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26354 Patch by Aleksey Shlyapnikov. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286148 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 367cace096..7b832ab563 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -200,7 +200,9 @@ static void addMemorySanitizerPass(const PassManagerBuilder &Builder, const PassManagerBuilderWrapper &BuilderWrapper = static_cast(Builder); const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts(); - PM.add(createMemorySanitizerPass(CGOpts.SanitizeMemoryTrackOrigins)); + int TrackOrigins = CGOpts.SanitizeMemoryTrackOrigins; + bool Recover = CGOpts.SanitizeRecover.has(SanitizerKind::Memory); + PM.add(createMemorySanitizerPass(TrackOrigins, Recover)); // MemorySanitizer inserts complex instrumentation that mostly follows // the logic of the original code, but operates on "shadow" values.