Skip to content
Snippets Groups Projects
Commit 3a166e2b authored by Evgeniy Stepanov's avatar Evgeniy Stepanov
Browse files

Add -fno-assume-sane-operator-new when building with MSan.

A workaroudn for PR16386. MSan's operator new aften has side-effects that are
miscompiled without this flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184410 91177308-0d34-0410-b5e6-96231b3b80d8
parent fbd4116c
No related branches found
No related tags found
No related merge requests found
......@@ -94,8 +94,12 @@ class SanitizerArgs {
CmdArgs.push_back(Args.MakeArgString("-fsanitize-memory-track-origins"));
if (AsanZeroBaseShadow)
CmdArgs.push_back(Args.MakeArgString(
"-fsanitize-address-zero-base-shadow"));
CmdArgs.push_back(
Args.MakeArgString("-fsanitize-address-zero-base-shadow"));
// Workaround for PR16386.
if (needsMsanRt())
CmdArgs.push_back(Args.MakeArgString("-fno-assume-sane-operator-new"));
}
private:
......
......@@ -139,3 +139,6 @@
// RUN: %clang -target x86_64-linux-gnu -fsanitize=address,leak -fno-sanitize=address %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-SANA-SANL-NO-SANA
// CHECK-SANA-SANL-NO-SANA: "-fsanitize=leak"
// RUN: %clang -target x86_64-linux-gnu -fsanitize=memory %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-MSAN
// CHECK-MSAN: "-fno-assume-sane-operator-new"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment