@@ -4238,18 +4238,19 @@ static Value *emitPointerArithmetic(CodeGenFunction &CGF,
4238
4238
PtrTy->getPointerAddressSpace ()))
4239
4239
return Ptr;
4240
4240
// The inbounds GEP of null is valid iff the index is zero.
4241
+ auto CheckOrdinal = SanitizerKind::SO_PointerOverflow;
4241
4242
auto CheckHandler = SanitizerHandler::PointerOverflow;
4242
- CodeGenFunction::SanitizerScope SanScope (
4243
- &CGF, {SanitizerKind::SO_PointerOverflow}, CheckHandler);
4243
+ CodeGenFunction::SanitizerScope SanScope (&CGF, {CheckOrdinal},
4244
+ CheckHandler);
4244
4245
Value *IsZeroIndex = CGF.Builder .CreateIsNull (index);
4245
4246
llvm::Constant *StaticArgs[] = {
4246
4247
CGF.EmitCheckSourceLocation (op.E ->getExprLoc ())};
4247
4248
llvm::Type *IntPtrTy = DL.getIntPtrType (PtrTy);
4248
4249
Value *IntPtr = llvm::Constant::getNullValue (IntPtrTy);
4249
4250
Value *ComputedGEP = CGF.Builder .CreateZExtOrTrunc (index, IntPtrTy);
4250
4251
Value *DynamicArgs[] = {IntPtr, ComputedGEP};
4251
- CGF.EmitCheck ({{IsZeroIndex, SanitizerKind::SO_PointerOverflow}} ,
4252
- CheckHandler, StaticArgs, DynamicArgs);
4252
+ CGF.EmitCheck ({{IsZeroIndex, CheckOrdinal}}, CheckHandler, StaticArgs ,
4253
+ DynamicArgs);
4253
4254
return Ptr;
4254
4255
}
4255
4256
@@ -4770,16 +4771,16 @@ Value *ScalarExprEmitter::EmitShl(const BinOpInfo &Ops) {
4770
4771
RHS = ConstrainShiftValue (Ops.LHS , RHS, " shl.mask" );
4771
4772
else if ((SanitizeBase || SanitizeExponent) &&
4772
4773
isa<llvm::IntegerType>(Ops.LHS ->getType ())) {
4773
- SmallVector<SanitizerKind::SanitizerOrdinal, 3 > Kinds ;
4774
+ SmallVector<SanitizerKind::SanitizerOrdinal, 3 > Ordinals ;
4774
4775
if (SanitizeSignedBase)
4775
- Kinds .push_back (SanitizerKind::SO_ShiftBase);
4776
+ Ordinals .push_back (SanitizerKind::SO_ShiftBase);
4776
4777
if (SanitizeUnsignedBase)
4777
- Kinds .push_back (SanitizerKind::SO_UnsignedShiftBase);
4778
+ Ordinals .push_back (SanitizerKind::SO_UnsignedShiftBase);
4778
4779
if (SanitizeExponent)
4779
- Kinds .push_back (SanitizerKind::SO_ShiftExponent);
4780
+ Ordinals .push_back (SanitizerKind::SO_ShiftExponent);
4780
4781
4781
4782
CodeGenFunction::SanitizerScope SanScope (
4782
- &CGF, Kinds , SanitizerHandler::ShiftOutOfBounds);
4783
+ &CGF, Ordinals , SanitizerHandler::ShiftOutOfBounds);
4783
4784
SmallVector<std::pair<Value *, SanitizerKind::SanitizerOrdinal>, 2 > Checks;
4784
4785
bool RHSIsSigned = Ops.rhsHasSignedIntegerRepresentation ();
4785
4786
llvm::Value *WidthMinusOne =
0 commit comments