Lines Matching refs:data

190 static void handle_overflow(struct overflow_data* data,  in handle_overflow()  argument
203 const struct type_descriptor* type = data->type; in handle_overflow()
214 log(&data->loc, overflow_kind, details); in handle_overflow()
219 struct overflow_data* data, in UBSAN_HANDLER() argument
222 handle_overflow(data, lhs, rhs, "+"); in UBSAN_HANDLER()
226 struct overflow_data* data, in UBSAN_HANDLER() argument
229 handle_overflow(data, lhs, rhs, "-"); in UBSAN_HANDLER()
233 struct overflow_data* data, in UBSAN_HANDLER() argument
236 handle_overflow(data, lhs, rhs, "*"); in UBSAN_HANDLER()
240 struct overflow_data* data, in UBSAN_HANDLER() argument
243 handle_overflow(data, lhs, rhs, "/%"); in UBSAN_HANDLER()
246 UBSAN_HANDLER(negate_overflow, struct overflow_data* data, value_handle_t val) { in UBSAN_HANDLER() argument
251 render_val(rendered_val, sizeof(rendered_val), data->type, val); in UBSAN_HANDLER()
254 data->type->name); in UBSAN_HANDLER()
256 log(&data->loc, "negation overflow", details); in UBSAN_HANDLER()
261 struct pointer_overflow_data* data, in UBSAN_HANDLER() argument
269 log(&data->loc, "pointer_overflow", details); in UBSAN_HANDLER()
274 struct implicit_conversion_data* data, in UBSAN_HANDLER() argument
283 if (data->check_kind < in UBSAN_HANDLER()
285 kind_str = implicit_conversion_check_kinds[data->check_kind]; in UBSAN_HANDLER()
290 render_val(rendered_src, sizeof(rendered_src), data->from_type, src); in UBSAN_HANDLER()
291 render_val(rendered_dst, sizeof(rendered_dst), data->to_type, dst); in UBSAN_HANDLER()
296 log(&data->loc, "implicit conversion", details); in UBSAN_HANDLER()
300 UBSAN_HANDLER(invalid_builtin, struct invalid_builtin_data* data) { in UBSAN_HANDLER() argument
303 switch (data->check_kind) { in UBSAN_HANDLER()
313 log(&data->loc, "invalid builtin usage", details); in UBSAN_HANDLER()
318 struct type_mismatch_data* data, in UBSAN_HANDLER() argument
323 intptr_t alignment = 1 << data->log_alignment; in UBSAN_HANDLER()
326 type_check_kinds[data->type_check_kind], data->type->name); in UBSAN_HANDLER()
331 type_check_kinds[data->type_check_kind], (void*)ptr, in UBSAN_HANDLER()
332 data->type->name, (int)alignment); in UBSAN_HANDLER()
337 type_check_kinds[data->type_check_kind], (void*)ptr, in UBSAN_HANDLER()
338 data->type->name); in UBSAN_HANDLER()
340 log(&data->loc, "type mismatch", details); in UBSAN_HANDLER()
344 UBSAN_HANDLER(builtin_unreachable, struct unreachable_data* data) { in UBSAN_HANDLER() argument
346 log(&data->loc, "hit a supposedly unreachable point", ""); in UBSAN_HANDLER()
351 UBSAN_HANDLER(missing_return, struct unreachable_data* data) { in UBSAN_HANDLER() argument
353 log(&data->loc, "hit a missing return statement", ""); in UBSAN_HANDLER()
367 struct shift_out_of_bounds_data* data, in UBSAN_HANDLER() argument
375 render_val(rendered_lhs, sizeof(rendered_lhs), data->lhs_type, lhs); in UBSAN_HANDLER()
376 render_val(rendered_rhs, sizeof(rendered_rhs), data->rhs_type, rhs); in UBSAN_HANDLER()
378 uint64_t rhs_u64 = val_unsigned(data->rhs_type, rhs); in UBSAN_HANDLER()
380 if (is_negative(data->rhs_type, rhs)) { in UBSAN_HANDLER()
383 } else if (type_width_bits(data->lhs_type) < rhs_u64) { in UBSAN_HANDLER()
386 data->lhs_type->name); in UBSAN_HANDLER()
387 } else if (is_negative(data->lhs_type, lhs)) { in UBSAN_HANDLER()
394 rendered_lhs, rendered_rhs, data->lhs_type->name); in UBSAN_HANDLER()
397 log(&data->loc, "shift out of bounds", details); in UBSAN_HANDLER()
402 struct out_of_bounds_data* data, in UBSAN_HANDLER() argument
408 render_val(rendered_index, sizeof(rendered_index), data->index_type, index); in UBSAN_HANDLER()
410 rendered_index, data->array_type->name); in UBSAN_HANDLER()
412 log(&data->loc, "out of bounds access", details); in UBSAN_HANDLER()
417 struct invalid_value_data* data, in UBSAN_HANDLER() argument
423 render_val(rendered_val, sizeof(rendered_val), data->type, val); in UBSAN_HANDLER()
426 data->type->name); in UBSAN_HANDLER()
428 log(&data->loc, "invalid value", details); in UBSAN_HANDLER()
433 struct float_cast_overflow_data* data, in UBSAN_HANDLER() argument
437 log(&data->loc, "float cast overflow", ""); in UBSAN_HANDLER()
442 struct cfi_check_fail_data* data, in UBSAN_HANDLER() argument
449 render_val(rendered_val, sizeof(rendered_val), data->type, val); in UBSAN_HANDLER()
451 rendered_val, data->type->name); in UBSAN_HANDLER()
452 log(&data->loc, "cfi check fail abort", details); in UBSAN_HANDLER()
457 struct vla_bound_data* data, in UBSAN_HANDLER() argument
463 render_val(rendered_val, sizeof(rendered_val), data->type, val); in UBSAN_HANDLER()
465 rendered_val, data->type->name); in UBSAN_HANDLER()
466 log(&data->loc, in UBSAN_HANDLER()
472 struct alignment_assumption_data* data, in UBSAN_HANDLER() argument
479 if (location_is_valid(data->assumption_loc)) { in UBSAN_HANDLER()
480 log(&data->assumption_loc, "alignment assumption was specified here", in UBSAN_HANDLER()
488 alignment, data->type->name); in UBSAN_HANDLER()
494 alignment, offset, data->type->name); in UBSAN_HANDLER()
497 log(&data->loc, "alignment assumption is incorrect", details); in UBSAN_HANDLER()