@@ -143,9 +143,9 @@ void TypeSanitizer::initializeCallbacks(Module &M) {
143
143
TysanCheck = cast<Function>(
144
144
M.getOrInsertFunction (kTysanCheckName , Attr, IRB.getVoidTy (),
145
145
IRB.getPtrTy (), // Pointer to data to be read.
146
- OrdTy, // Size of the data in bytes.
146
+ OrdTy, // Size of the data in bytes.
147
147
IRB.getPtrTy (), // Pointer to type descriptor.
148
- OrdTy // Flags.
148
+ OrdTy // Flags.
149
149
)
150
150
.getCallee ());
151
151
@@ -601,7 +601,7 @@ bool TypeSanitizer::instrumentWithShadowUpdate(
601
601
602
602
Value *ShadowDataInt = ConvertToShadowDataInt (IRB, Ptr, IntptrTy, PtrShift,
603
603
ShadowBase, AppMemMask);
604
- Type *Int8PtrPtrTy = IRB.getPtrTy ()-> getPointerTo ( );
604
+ Type *Int8PtrPtrTy = PointerType::get ( IRB.getPtrTy (), 0 );
605
605
Value *ShadowData =
606
606
IRB.CreateIntToPtr (ShadowDataInt, Int8PtrPtrTy, " shadow.ptr" );
607
607
@@ -637,8 +637,7 @@ bool TypeSanitizer::instrumentWithShadowUpdate(
637
637
Constant *Flags =
638
638
ConstantInt::get (OrdTy, (int )IsRead | (((int )IsWrite) << 1 ));
639
639
640
- Value *LoadedTD =
641
- IRB.CreateLoad (IRB.getPtrTy (), ShadowData, " shadow.desc" );
640
+ Value *LoadedTD = IRB.CreateLoad (IRB.getPtrTy (), ShadowData, " shadow.desc" );
642
641
if (SanitizeFunction) {
643
642
Value *BadTDCmp = IRB.CreateICmpNE (LoadedTD, TD, " bad.desc" );
644
643
Instruction *BadTDTerm, *GoodTDTerm;
@@ -673,16 +672,16 @@ bool TypeSanitizer::instrumentWithShadowUpdate(
673
672
Instruction *BadUTDTerm = SplitBlockAndInsertIfThen (
674
673
NotAllUnkTD, BeforeSetType, false , UnlikelyBW);
675
674
IRB.SetInsertPoint (BadUTDTerm);
676
- IRB.CreateCall (TysanCheck, {IRB.CreateBitCast (Ptr, IRB.getPtrTy ()),
677
- Size, (Value *)TD, (Value *)Flags});
675
+ IRB.CreateCall (TysanCheck, {IRB.CreateBitCast (Ptr, IRB.getPtrTy ()), Size,
676
+ (Value *)TD, (Value *)Flags});
678
677
679
678
IRB.SetInsertPoint (BeforeSetType);
680
679
SetType ();
681
680
682
681
// We have a non-trivial mismatch. Call the runtime.
683
682
IRB.SetInsertPoint (MismatchTerm);
684
- IRB.CreateCall (TysanCheck, {IRB.CreateBitCast (Ptr, IRB.getPtrTy ()),
685
- Size, (Value *)TD, (Value *)Flags});
683
+ IRB.CreateCall (TysanCheck, {IRB.CreateBitCast (Ptr, IRB.getPtrTy ()), Size,
684
+ (Value *)TD, (Value *)Flags});
686
685
687
686
// We appear to have the right type. Make sure that all other bytes in
688
687
// the type are still marked as interior bytes. If not, call the runtime.
@@ -703,8 +702,8 @@ bool TypeSanitizer::instrumentWithShadowUpdate(
703
702
Instruction *BadITDTerm = SplitBlockAndInsertIfThen (
704
703
NotAllBadTD, &*IRB.GetInsertPoint (), false , UnlikelyBW);
705
704
IRB.SetInsertPoint (BadITDTerm);
706
- IRB.CreateCall (TysanCheck, {IRB.CreateBitCast (Ptr, IRB.getPtrTy ()),
707
- Size, (Value *)TD, (Value *)Flags});
705
+ IRB.CreateCall (TysanCheck, {IRB.CreateBitCast (Ptr, IRB.getPtrTy ()), Size,
706
+ (Value *)TD, (Value *)Flags});
708
707
} else {
709
708
// If we're not sanitizing this function, then we only care whether we
710
709
// need to *set* the type.
@@ -843,8 +842,7 @@ bool TypeSanitizer::instrumentMemInst(Value *V, Value *&ShadowBase,
843
842
IRB.CreateAnd (IRB.CreatePtrToInt (Src, IntptrTy), AppMemMask),
844
843
PtrShift),
845
844
ShadowBase);
846
- Value *SrcShadowData =
847
- IRB.CreateIntToPtr (SrcShadowDataInt, IRB.getPtrTy ());
845
+ Value *SrcShadowData = IRB.CreateIntToPtr (SrcShadowDataInt, IRB.getPtrTy ());
848
846
849
847
if (NeedsMemMove) {
850
848
IRB.CreateMemMove (ShadowData, Align (1u << PtrShift), SrcShadowData,
0 commit comments