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