[llvm] r341646 - [MSan] don't access MsanCtorFunction when using KMSAN

Alexander Potapenko via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 7 02:56:36 PDT 2018


Author: glider
Date: Fri Sep  7 02:56:36 2018
New Revision: 341646

URL: http://llvm.org/viewvc/llvm-project?rev=341646&view=rev
Log:
[MSan] don't access MsanCtorFunction when using KMSAN

MSan has found a use of uninitialized memory in MSan, fix it.

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp?rev=341646&r1=341645&r2=341646&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp Fri Sep  7 02:56:36 2018
@@ -4342,7 +4342,7 @@ static VarArgHelper *CreateVarArgHelper(
 }
 
 bool MemorySanitizer::runOnFunction(Function &F) {
-  if (&F == MsanCtorFunction)
+  if (!CompileKernel && (&F == MsanCtorFunction))
     return false;
   MemorySanitizerVisitor Visitor(F, *this);
 




More information about the llvm-commits mailing list