[llvm] r360658 - [MemorySanitizer] getMMXVectorTy - assert valid element size. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue May 14 03:29:18 PDT 2019
Author: rksimon
Date: Tue May 14 03:29:18 2019
New Revision: 360658
URL: http://llvm.org/viewvc/llvm-project?rev=360658&view=rev
Log:
[MemorySanitizer] getMMXVectorTy - assert valid element size. NFCI.
Fixes scan-build warnings
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=360658&r1=360657&r2=360658&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/MemorySanitizer.cpp Tue May 14 03:29:18 2019
@@ -2712,6 +2712,8 @@ struct MemorySanitizerVisitor : public I
// Get an X86_MMX-sized vector type.
Type *getMMXVectorTy(unsigned EltSizeInBits) {
const unsigned X86_MMXSizeInBits = 64;
+ assert(EltSizeInBits != 0 && (X86_MMXSizeInBits % EltSizeInBits) == 0 &&
+ "Illegal MMX vector element size");
return VectorType::get(IntegerType::get(*MS.C, EltSizeInBits),
X86_MMXSizeInBits / EltSizeInBits);
}
More information about the llvm-commits
mailing list