Teach InstCombine to work with smaller legal types in icmp (shl %v, C1), C2
[oota-llvm.git] / lib / Transforms / Instrumentation / AddressSanitizer.cpp
index 4950d838b294c7326155734ada3dd779961de43b..5769e942a59f7c69b33ba982783d9e7fdaf5c3c6 100644 (file)
@@ -219,7 +219,8 @@ static ShadowMapping getShadowMapping(const Module &M, int LongSize,
   if (!ZeroBaseShadow && ClShort64BitOffset && IsX86_64 && !IsMacOSX) {
     assert(LongSize == 64);
     Mapping.Offset = kDefaultShort64bitShadowOffset;
-  } if (!ZeroBaseShadow && ClMappingOffsetLog >= 0) {
+  }
+  if (!ZeroBaseShadow && ClMappingOffsetLog >= 0) {
     // Zero offset log is the special case.
     Mapping.Offset = (ClMappingOffsetLog == 0) ? 0 : 1ULL << ClMappingOffsetLog;
   }
@@ -638,7 +639,7 @@ void AddressSanitizer::instrumentMop(Instruction *I) {
   Type *OrigTy = cast<PointerType>(OrigPtrTy)->getElementType();
 
   assert(OrigTy->isSized());
-  uint32_t TypeSize = TD->getTypeStoreSizeInBits(OrigTy);
+  uint32_t TypeSize = TD->getTypeAllocSizeInBits(OrigTy);
 
   if (TypeSize != 8  && TypeSize != 16 &&
       TypeSize != 32 && TypeSize != 64 && TypeSize != 128) {