[WebAssembly] Support Leak Sanitizer on Emscripten
authorThomas Lively <tlively@google.com>
Thu, 6 Jun 2019 01:38:12 +0000 (01:38 +0000)
committerThomas Lively <tlively@google.com>
Thu, 6 Jun 2019 01:38:12 +0000 (01:38 +0000)
Summary:
LSan is currently being ported to Emscripten and mostly works.

Enabling the support in upstream would simplify testing.

Patch by Guanzhong Chen.

Reviewers: tlively, aheejin

Reviewed By: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D62830

llvm-svn: 362667

clang/lib/Driver/ToolChains/WebAssembly.cpp

index 7fffbbe..9f63d2e 100644 (file)
@@ -211,7 +211,7 @@ void WebAssembly::AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
 SanitizerMask WebAssembly::getSupportedSanitizers() const {
   SanitizerMask Res = ToolChain::getSupportedSanitizers();
   if (getTriple().isOSEmscripten()) {
-    Res |= SanitizerKind::Vptr;
+    Res |= SanitizerKind::Vptr | SanitizerKind::Leak;
   }
   return Res;
 }