Lines Matching refs:Data
44 static void handleTypeMismatchImpl(TypeMismatchData *Data, ValueHandle Pointer, in handleTypeMismatchImpl() argument
46 Location Loc = Data->Loc.acquire(); in handleTypeMismatchImpl()
51 else if (Data->Alignment && (Pointer & (Data->Alignment - 1))) in handleTypeMismatchImpl()
62 if (Data->Loc.isInvalid()) { in handleTypeMismatchImpl()
72 << TypeCheckKinds[Data->TypeCheckKind] << Data->Type; in handleTypeMismatchImpl()
77 << TypeCheckKinds[Data->TypeCheckKind] << (void *)Pointer in handleTypeMismatchImpl()
78 << Data->Alignment << Data->Type; in handleTypeMismatchImpl()
83 << TypeCheckKinds[Data->TypeCheckKind] << (void *)Pointer << Data->Type; in handleTypeMismatchImpl()
93 void __ubsan::__ubsan_handle_type_mismatch(TypeMismatchData *Data, in __ubsan_handle_type_mismatch() argument
96 handleTypeMismatchImpl(Data, Pointer, Opts); in __ubsan_handle_type_mismatch()
98 void __ubsan::__ubsan_handle_type_mismatch_abort(TypeMismatchData *Data, in __ubsan_handle_type_mismatch_abort() argument
101 handleTypeMismatchImpl(Data, Pointer, Opts); in __ubsan_handle_type_mismatch_abort()
107 static void handleIntegerOverflowImpl(OverflowData *Data, ValueHandle LHS, in handleIntegerOverflowImpl() argument
110 SourceLocation Loc = Data->Loc.acquire(); in handleIntegerOverflowImpl()
111 bool IsSigned = Data->Type.isSignedIntegerTy(); in handleIntegerOverflowImpl()
123 << Value(Data->Type, LHS) << Operator << RHS << Data->Type; in handleIntegerOverflowImpl()
127 void __ubsan::handler_name(OverflowData *Data, ValueHandle LHS, \
130 handleIntegerOverflowImpl(Data, LHS, op, Value(Data->Type, RHS), Opts); \
142 static void handleNegateOverflowImpl(OverflowData *Data, ValueHandle OldVal, in handleNegateOverflowImpl() argument
144 SourceLocation Loc = Data->Loc.acquire(); in handleNegateOverflowImpl()
145 bool IsSigned = Data->Type.isSignedIntegerTy(); in handleNegateOverflowImpl()
158 << Value(Data->Type, OldVal) << Data->Type; in handleNegateOverflowImpl()
161 << Value(Data->Type, OldVal) << Data->Type; in handleNegateOverflowImpl()
164 void __ubsan::__ubsan_handle_negate_overflow(OverflowData *Data, in __ubsan_handle_negate_overflow() argument
167 handleNegateOverflowImpl(Data, OldVal, Opts); in __ubsan_handle_negate_overflow()
169 void __ubsan::__ubsan_handle_negate_overflow_abort(OverflowData *Data, in __ubsan_handle_negate_overflow_abort() argument
172 handleNegateOverflowImpl(Data, OldVal, Opts); in __ubsan_handle_negate_overflow_abort()
176 static void handleDivremOverflowImpl(OverflowData *Data, ValueHandle LHS, in handleDivremOverflowImpl() argument
178 SourceLocation Loc = Data->Loc.acquire(); in handleDivremOverflowImpl()
179 Value LHSVal(Data->Type, LHS); in handleDivremOverflowImpl()
180 Value RHSVal(Data->Type, RHS); in handleDivremOverflowImpl()
185 else if (Data->Type.isIntegerTy()) in handleDivremOverflowImpl()
198 << LHSVal << Data->Type; in handleDivremOverflowImpl()
206 void __ubsan::__ubsan_handle_divrem_overflow(OverflowData *Data, in __ubsan_handle_divrem_overflow() argument
209 handleDivremOverflowImpl(Data, LHS, RHS, Opts); in __ubsan_handle_divrem_overflow()
211 void __ubsan::__ubsan_handle_divrem_overflow_abort(OverflowData *Data, in __ubsan_handle_divrem_overflow_abort() argument
215 handleDivremOverflowImpl(Data, LHS, RHS, Opts); in __ubsan_handle_divrem_overflow_abort()
219 static void handleShiftOutOfBoundsImpl(ShiftOutOfBoundsData *Data, in handleShiftOutOfBoundsImpl() argument
222 SourceLocation Loc = Data->Loc.acquire(); in handleShiftOutOfBoundsImpl()
223 Value LHSVal(Data->LHSType, LHS); in handleShiftOutOfBoundsImpl()
224 Value RHSVal(Data->RHSType, RHS); in handleShiftOutOfBoundsImpl()
228 RHSVal.getPositiveIntValue() >= Data->LHSType.getIntegerBitWidth()) in handleShiftOutOfBoundsImpl()
243 << RHSVal << Data->LHSType.getIntegerBitWidth() << Data->LHSType; in handleShiftOutOfBoundsImpl()
250 << LHSVal << RHSVal << Data->LHSType; in handleShiftOutOfBoundsImpl()
254 void __ubsan::__ubsan_handle_shift_out_of_bounds(ShiftOutOfBoundsData *Data, in __ubsan_handle_shift_out_of_bounds() argument
258 handleShiftOutOfBoundsImpl(Data, LHS, RHS, Opts); in __ubsan_handle_shift_out_of_bounds()
261 ShiftOutOfBoundsData *Data, in __ubsan_handle_shift_out_of_bounds_abort() argument
265 handleShiftOutOfBoundsImpl(Data, LHS, RHS, Opts); in __ubsan_handle_shift_out_of_bounds_abort()
269 static void handleOutOfBoundsImpl(OutOfBoundsData *Data, ValueHandle Index, in handleOutOfBoundsImpl() argument
271 SourceLocation Loc = Data->Loc.acquire(); in handleOutOfBoundsImpl()
279 Value IndexVal(Data->IndexType, Index); in handleOutOfBoundsImpl()
281 << IndexVal << Data->ArrayType; in handleOutOfBoundsImpl()
284 void __ubsan::__ubsan_handle_out_of_bounds(OutOfBoundsData *Data, in __ubsan_handle_out_of_bounds() argument
287 handleOutOfBoundsImpl(Data, Index, Opts); in __ubsan_handle_out_of_bounds()
289 void __ubsan::__ubsan_handle_out_of_bounds_abort(OutOfBoundsData *Data, in __ubsan_handle_out_of_bounds_abort() argument
292 handleOutOfBoundsImpl(Data, Index, Opts); in __ubsan_handle_out_of_bounds_abort()
296 static void handleBuiltinUnreachableImpl(UnreachableData *Data, in handleBuiltinUnreachableImpl() argument
298 ScopedReport R(Opts, Data->Loc, ErrorType::UnreachableCall); in handleBuiltinUnreachableImpl()
299 Diag(Data->Loc, DL_Error, "execution reached a __builtin_unreachable() call"); in handleBuiltinUnreachableImpl()
302 void __ubsan::__ubsan_handle_builtin_unreachable(UnreachableData *Data) { in __ubsan_handle_builtin_unreachable() argument
304 handleBuiltinUnreachableImpl(Data, Opts); in __ubsan_handle_builtin_unreachable()
308 static void handleMissingReturnImpl(UnreachableData *Data, ReportOptions Opts) { in handleMissingReturnImpl() argument
309 ScopedReport R(Opts, Data->Loc, ErrorType::MissingReturn); in handleMissingReturnImpl()
310 Diag(Data->Loc, DL_Error, in handleMissingReturnImpl()
315 void __ubsan::__ubsan_handle_missing_return(UnreachableData *Data) { in __ubsan_handle_missing_return() argument
317 handleMissingReturnImpl(Data, Opts); in __ubsan_handle_missing_return()
321 static void handleVLABoundNotPositive(VLABoundData *Data, ValueHandle Bound, in handleVLABoundNotPositive() argument
323 SourceLocation Loc = Data->Loc.acquire(); in handleVLABoundNotPositive()
333 << Value(Data->Type, Bound); in handleVLABoundNotPositive()
336 void __ubsan::__ubsan_handle_vla_bound_not_positive(VLABoundData *Data, in __ubsan_handle_vla_bound_not_positive() argument
339 handleVLABoundNotPositive(Data, Bound, Opts); in __ubsan_handle_vla_bound_not_positive()
341 void __ubsan::__ubsan_handle_vla_bound_not_positive_abort(VLABoundData *Data, in __ubsan_handle_vla_bound_not_positive_abort() argument
344 handleVLABoundNotPositive(Data, Bound, Opts); in __ubsan_handle_vla_bound_not_positive_abort()
348 static bool looksLikeFloatCastOverflowDataV1(void *Data) { in looksLikeFloatCastOverflowDataV1() argument
352 internal_memcpy(&FilenameOrTypeDescriptor, Data, in looksLikeFloatCastOverflowDataV1()
374 auto Data = reinterpret_cast<FloatCastOverflowData *>(DataPtr); in handleFloatCastOverflow() local
377 FromType = &Data->FromType; in handleFloatCastOverflow()
378 ToType = &Data->ToType; in handleFloatCastOverflow()
380 auto Data = reinterpret_cast<FloatCastOverflowDataV2 *>(DataPtr); in handleFloatCastOverflow() local
381 SourceLocation SLoc = Data->Loc.acquire(); in handleFloatCastOverflow()
385 FromType = &Data->FromType; in handleFloatCastOverflow()
386 ToType = &Data->ToType; in handleFloatCastOverflow()
396 void __ubsan::__ubsan_handle_float_cast_overflow(void *Data, ValueHandle From) { in __ubsan_handle_float_cast_overflow() argument
398 handleFloatCastOverflow(Data, From, Opts); in __ubsan_handle_float_cast_overflow()
400 void __ubsan::__ubsan_handle_float_cast_overflow_abort(void *Data, in __ubsan_handle_float_cast_overflow_abort() argument
403 handleFloatCastOverflow(Data, From, Opts); in __ubsan_handle_float_cast_overflow_abort()
407 static void handleLoadInvalidValue(InvalidValueData *Data, ValueHandle Val, in handleLoadInvalidValue() argument
409 SourceLocation Loc = Data->Loc.acquire(); in handleLoadInvalidValue()
412 bool IsBool = (0 == internal_strcmp(Data->Type.getTypeName(), "'bool'")); in handleLoadInvalidValue()
423 << Value(Data->Type, Val) << Data->Type; in handleLoadInvalidValue()
426 void __ubsan::__ubsan_handle_load_invalid_value(InvalidValueData *Data, in __ubsan_handle_load_invalid_value() argument
429 handleLoadInvalidValue(Data, Val, Opts); in __ubsan_handle_load_invalid_value()
431 void __ubsan::__ubsan_handle_load_invalid_value_abort(InvalidValueData *Data, in __ubsan_handle_load_invalid_value_abort() argument
434 handleLoadInvalidValue(Data, Val, Opts); in __ubsan_handle_load_invalid_value_abort()
438 static void handleFunctionTypeMismatch(FunctionTypeMismatchData *Data, in handleFunctionTypeMismatch() argument
441 SourceLocation CallLoc = Data->Loc.acquire(); in handleFunctionTypeMismatch()
456 << FName << Data->Type; in handleFunctionTypeMismatch()
461 __ubsan::__ubsan_handle_function_type_mismatch(FunctionTypeMismatchData *Data, in __ubsan_handle_function_type_mismatch() argument
464 handleFunctionTypeMismatch(Data, Function, Opts); in __ubsan_handle_function_type_mismatch()
468 FunctionTypeMismatchData *Data, ValueHandle Function) { in __ubsan_handle_function_type_mismatch_abort() argument
470 handleFunctionTypeMismatch(Data, Function, Opts); in __ubsan_handle_function_type_mismatch_abort()
474 static void handleNonNullReturn(NonNullReturnData *Data, ReportOptions Opts) { in handleNonNullReturn() argument
475 SourceLocation Loc = Data->Loc.acquire(); in handleNonNullReturn()
485 if (!Data->AttrLoc.isInvalid()) in handleNonNullReturn()
486 Diag(Data->AttrLoc, DL_Note, "returns_nonnull attribute specified here"); in handleNonNullReturn()
489 void __ubsan::__ubsan_handle_nonnull_return(NonNullReturnData *Data) { in __ubsan_handle_nonnull_return() argument
491 handleNonNullReturn(Data, Opts); in __ubsan_handle_nonnull_return()
494 void __ubsan::__ubsan_handle_nonnull_return_abort(NonNullReturnData *Data) { in __ubsan_handle_nonnull_return_abort() argument
496 handleNonNullReturn(Data, Opts); in __ubsan_handle_nonnull_return_abort()
500 static void handleNonNullArg(NonNullArgData *Data, ReportOptions Opts) { in handleNonNullArg() argument
501 SourceLocation Loc = Data->Loc.acquire(); in handleNonNullArg()
510 "never be null") << Data->ArgIndex; in handleNonNullArg()
511 if (!Data->AttrLoc.isInvalid()) in handleNonNullArg()
512 Diag(Data->AttrLoc, DL_Note, "nonnull attribute specified here"); in handleNonNullArg()
515 void __ubsan::__ubsan_handle_nonnull_arg(NonNullArgData *Data) { in __ubsan_handle_nonnull_arg() argument
517 handleNonNullArg(Data, Opts); in __ubsan_handle_nonnull_arg()
520 void __ubsan::__ubsan_handle_nonnull_arg_abort(NonNullArgData *Data) { in __ubsan_handle_nonnull_arg_abort() argument
522 handleNonNullArg(Data, Opts); in __ubsan_handle_nonnull_arg_abort()
526 static void handleCFIBadIcall(CFICheckFailData *Data, ValueHandle Function, in handleCFIBadIcall() argument
528 if (Data->CheckKind != CFITCK_ICall) in handleCFIBadIcall()
531 SourceLocation Loc = Data->Loc.acquire(); in handleCFIBadIcall()
541 << Data->Type; in handleCFIBadIcall()
553 void HandleCFIBadType(CFICheckFailData *Data, ValueHandle Vtable,
556 static void HandleCFIBadType(CFICheckFailData *Data, ValueHandle Vtable,
563 void __ubsan::__ubsan_handle_cfi_check_fail(CFICheckFailData *Data, in __ubsan_handle_cfi_check_fail() argument
567 if (Data->CheckKind == CFITCK_ICall) in __ubsan_handle_cfi_check_fail()
568 handleCFIBadIcall(Data, Value, Opts); in __ubsan_handle_cfi_check_fail()
570 HandleCFIBadType(Data, Value, ValidVtable, Opts); in __ubsan_handle_cfi_check_fail()
573 void __ubsan::__ubsan_handle_cfi_check_fail_abort(CFICheckFailData *Data, in __ubsan_handle_cfi_check_fail_abort() argument
577 if (Data->CheckKind == CFITCK_ICall) in __ubsan_handle_cfi_check_fail_abort()
578 handleCFIBadIcall(Data, Value, Opts); in __ubsan_handle_cfi_check_fail_abort()
580 HandleCFIBadType(Data, Value, ValidVtable, Opts); in __ubsan_handle_cfi_check_fail_abort()