if (!UseShortGranules)
Size = AlignedSize;
- Value *JustTag = IRB.CreateTrunc(Tag, IRB.getInt8Ty());
+ Tag = IRB.CreateTrunc(Tag, IRB.getInt8Ty());
if (InstrumentWithCalls) {
IRB.CreateCall(HwasanTagMemoryFunc,
- {IRB.CreatePointerCast(AI, Int8PtrTy), JustTag,
+ {IRB.CreatePointerCast(AI, Int8PtrTy), Tag,
ConstantInt::get(IntptrTy, AlignedSize)});
} else {
size_t ShadowSize = Size >> Mapping.Scale;
// llvm.memset right here into either a sequence of stores, or a call to
// hwasan_tag_memory.
if (ShadowSize)
- IRB.CreateMemSet(ShadowPtr, JustTag, ShadowSize, Align(1));
+ IRB.CreateMemSet(ShadowPtr, Tag, ShadowSize, Align(1));
if (Size != AlignedSize) {
const uint8_t SizeRemainder = Size % Mapping.getObjectAlignment().value();
IRB.CreateStore(ConstantInt::get(Int8Ty, SizeRemainder),
IRB.CreateConstGEP1_32(Int8Ty, ShadowPtr, ShadowSize));
- IRB.CreateStore(JustTag, IRB.CreateConstGEP1_32(
- Int8Ty, IRB.CreatePointerCast(AI, Int8PtrTy),
- AlignedSize - 1));
+ IRB.CreateStore(Tag, IRB.CreateConstGEP1_32(
+ Int8Ty, IRB.CreatePointerCast(AI, Int8PtrTy),
+ AlignedSize - 1));
}
}
}