• Home
  • Raw
  • Download

Lines Matching refs:type

60 static bool type_is_int(struct type_descriptor *type)  in type_is_int()  argument
62 return type->type_kind == type_kind_int; in type_is_int()
65 static bool type_is_signed(struct type_descriptor *type) in type_is_signed() argument
67 WARN_ON(!type_is_int(type)); in type_is_signed()
68 return type->type_info & 1; in type_is_signed()
71 static unsigned type_bit_width(struct type_descriptor *type) in type_bit_width() argument
73 return 1 << (type->type_info >> 1); in type_bit_width()
76 static bool is_inline_int(struct type_descriptor *type) in is_inline_int() argument
79 unsigned bits = type_bit_width(type); in is_inline_int()
81 WARN_ON(!type_is_int(type)); in is_inline_int()
86 static s_max get_signed_val(struct type_descriptor *type, void *val) in get_signed_val() argument
88 if (is_inline_int(type)) { in get_signed_val()
89 unsigned extra_bits = sizeof(s_max)*8 - type_bit_width(type); in get_signed_val()
95 if (type_bit_width(type) == 64) in get_signed_val()
101 static bool val_is_negative(struct type_descriptor *type, void *val) in val_is_negative() argument
103 return type_is_signed(type) && get_signed_val(type, val) < 0; in val_is_negative()
106 static u_max get_unsigned_val(struct type_descriptor *type, void *val) in get_unsigned_val() argument
108 if (is_inline_int(type)) in get_unsigned_val()
111 if (type_bit_width(type) == 64) in get_unsigned_val()
117 static void val_to_string(char *str, size_t size, struct type_descriptor *type, in val_to_string() argument
120 if (type_is_int(type)) { in val_to_string()
121 if (type_bit_width(type) == 128) { in val_to_string()
123 u_max val = get_unsigned_val(type, value); in val_to_string()
133 } else if (type_is_signed(type)) { in val_to_string()
135 (s64)get_signed_val(type, value)); in val_to_string()
138 (u64)get_unsigned_val(type, value)); in val_to_string()
165 struct type_descriptor *type = data->type; in handle_overflow() local
174 val_to_string(lhs_val_str, sizeof(lhs_val_str), type, lhs); in handle_overflow()
175 val_to_string(rhs_val_str, sizeof(rhs_val_str), type, rhs); in handle_overflow()
177 type_is_signed(type) ? "signed" : "unsigned"); in handle_overflow()
182 type->type_name); in handle_overflow()
219 val_to_string(old_val_str, sizeof(old_val_str), data->type, old_val); in __ubsan_handle_negate_overflow()
222 old_val_str, data->type->type_name); in __ubsan_handle_negate_overflow()
239 val_to_string(rhs_val_str, sizeof(rhs_val_str), data->type, rhs); in __ubsan_handle_divrem_overflow()
241 if (type_is_signed(data->type) && get_signed_val(data->type, rhs) == -1) in __ubsan_handle_divrem_overflow()
243 rhs_val_str, data->type->type_name); in __ubsan_handle_divrem_overflow()
260 data->type->type_name); in handle_null_ptr_deref()
275 (void *)ptr, data->type->type_name); in handle_misaligned_access()
291 pr_err("for an object of type %s\n", data->type->type_name); in handle_object_size_mismatch()
315 .type = data->type, in __ubsan_handle_type_mismatch()
330 .type = data->type, in __ubsan_handle_type_mismatch_v1()
416 val_to_string(val_str, sizeof(val_str), data->type, val); in __ubsan_handle_load_invalid_value()
419 val_str, data->type->type_name); in __ubsan_handle_load_invalid_value()