@@ -76,6 +76,16 @@ enum {
7676 implicit_conversion_signed_integer_truncation_or_sign_change = 4 ,
7777};
7878
79+ enum {
80+ cfi_type_check_v_call ,
81+ cfi_type_check_nv_call ,
82+ cfi_type_check_derived_cast ,
83+ cfi_type_check_unrelated_cast ,
84+ cfi_type_check_i_call ,
85+ cfi_type_check_nvmf_call ,
86+ cfi_type_check_vmf_call ,
87+ };
88+
7989struct type_descriptor {
8090 uint16_t type_kind ;
8191 uint16_t type_info ;
@@ -121,6 +131,13 @@ struct float_cast_overflow_data {
121131 struct type_descriptor * to_type ;
122132};
123133
134+ struct dynamic_type_cache_miss_data {
135+ struct source_location location ;
136+ struct type_descriptor * type ;
137+ void * type_info ;
138+ unsigned char type_check_kind ;
139+ };
140+
124141struct type_mismatch_data {
125142 struct source_location location ;
126143 struct type_descriptor * type ;
@@ -201,6 +218,12 @@ struct alignment_assumption_data {
201218 struct type_descriptor * type ;
202219};
203220
221+ struct cfi_check_fail_data {
222+ unsigned char cfi_type_check_kind ;
223+ struct source_location location ;
224+ struct type_descriptor * type ;
225+ };
226+
204227struct vla_bound_not_positive_data {
205228 struct source_location location ;
206229 struct type_descriptor * type ;
@@ -221,19 +244,27 @@ void
221244__ubsan_handle_builtin_unreachable (void * data );
222245
223246void
224- __ubsan_cfi_bad_icall (void * data ,
225- void * function );
247+ __ubsan_handle_cfi_bad_type (void * data ,
248+ void * vtable ,
249+ void * valid_vtable ,
250+ void * opts );
251+
226252
227253void
228- __ubsan_cfi_check_fail (void * data ,
229- void * function ,
230- uintptr_t vtable_is_valid );
254+ __ubsan_handle_cfi_check_fail (void * data ,
255+ void * function ,
256+ void * vtable_is_valid );
231257
232258void
233259__ubsan_handle_divrem_overflow (void * data ,
234260 void * lhs ,
235261 void * rhs );
236262
263+ void
264+ __ubsan_handle_dynamic_type_cache_miss (void * data ,
265+ void * pointer ,
266+ void * hash );
267+
237268void
238269__ubsan_handle_float_cast_overflow (void * data ,
239270 void * from );
@@ -258,6 +289,10 @@ void
258289__ubsan_handle_load_invalid_value (void * data ,
259290 void * val );
260291
292+ void
293+ __ubsan_handle_local_out_of_bounds (
294+ );
295+
261296void
262297__ubsan_handle_missing_return (void * data );
263298
@@ -357,4 +392,7 @@ __ubsan_val_to_umax(struct type_descriptor *type,
357392const char *
358393__ubsan_type_check_to_string (unsigned char type_check_kind );
359394
395+ const char *
396+ __ubsan_cfi_type_check_to_string (unsigned char cfi_type_check_kind );
397+
360398#endif /* _UBSAN_H_ */
0 commit comments