Skip to content

Commit

Permalink
Fixed a codegen bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Nagy committed Aug 7, 2024
1 parent 9a00ffd commit 46af41f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1877,10 +1877,6 @@ void AddressSanitizer::instrumentAddress(Instruction *OrigIns,
}

InstrumentationIRBuilder IRB(InsertBefore);
if (CLAsanDormant)
IRB.SetInsertPoint(SplitBlockAndInsertIfThen(
IRB.CreateNot(IRB.CreateLoad(IRB.getInt1Ty(), DormantAsanFlag)),
InsertBefore, false));

size_t AccessSizeIndex = TypeStoreSizeToSizeIndex(TypeStoreSize);
const ASanAccessInfo AccessInfo(IsWrite, CompileKernel, AccessSizeIndex);
Expand Down Expand Up @@ -1965,6 +1961,11 @@ void AddressSanitizer::instrumentUnusualSizeOrAlignment(
TypeSize TypeStoreSize, bool IsWrite, Value *SizeArgument, bool UseCalls,
uint32_t Exp, RuntimeCallInserter &RTCI) {
InstrumentationIRBuilder IRB(InsertBefore);
if (CLAsanDormant)
IRB.SetInsertPoint(SplitBlockAndInsertIfThen(
IRB.CreateNot(IRB.CreateLoad(IRB.getInt1Ty(), DormantAsanFlag)),
InsertBefore, false));

Value *NumBits = IRB.CreateTypeSize(IntptrTy, TypeStoreSize);
Value *Size = IRB.CreateLShr(NumBits, ConstantInt::get(IntptrTy, 3));

Expand Down

0 comments on commit 46af41f

Please sign in to comment.