![]() |
Max OS 0.3
|
Implementation of the Undefined Behavior Sanitizer (UBSan) handler. More...
Go to the source code of this file.
Functions | |
| void | __ubsan_handle_type_mismatch (type_mismatch_info_t *info, uintptr_t ptr) |
| Triggered when memory is accessed with an unexpected type. | |
| void | __ubsan_handle_type_mismatch_v1 (type_mismatch_info_v1_t *info, uintptr_t ptr) |
| Triggered when memory is accessed with an unexpected type (UBSan v1 - includes more metadata) | |
| void | __ubsan_handle_pointer_overflow (overflow_info_t *info) |
| Triggered when adding/subbing to a memory address is outside the expected bounds. | |
| void | __ubsan_handle_sub_overflow (overflow_info_t *info) |
| Triggered when subtracting below the minimum value for the type. | |
| void | __ubsan_handle_shift_out_of_bounds (shift_out_of_bounds_info_t *info) |
| Triggered when shifting beyond the capacity of the type. | |
| void | __ubsan_handle_out_of_bounds (out_of_bounds_info_t *info) |
| Triggered when accessing an array at an index larger than its size (or negative) | |
| void | __ubsan_handle_add_overflow (overflow_info_t *info) |
| Triggered when adding beyond the maximum value for the type. | |
| void | __ubsan_handle_divrem_overflow (overflow_info_t *info) |
| Triggered when dividing or taking the remainder results in an overflow (eg dividing INT_MIN by -1) | |
| void | __ubsan_handle_negate_overflow (overflow_info_t *info) |
| Triggered when negating (taking -x) when there is no corresponding positive/negative value. | |
| void | __ubsan_handle_builtin_unreachable (location_only_info_t *info) |
| Triggered when reaching code that should be unreachable. | |
| void | __ubsan_handle_mul_overflow (overflow_info_t *info) |
| Triggered when multiplying beyond the maximum value for the type. | |
| void | __ubsan_handle_load_invalid_value (invalid_value_info_t *info) |
| Triggered when loading a value that is invalid for its type (eg corrupted or uninitialised) | |
| void | __ubsan_handle_missing_return (location_only_info_t *info) |
| Triggered when a function that is expected to return a value does not. | |
| void | __ubsan_handle_vla_bound_not_positive (vla_bound_not_positive_info_t *info) |
| Triggered when a variable length array (VLA) is declared with a non-positive bound. | |
Implementation of the Undefined Behavior Sanitizer (UBSan) handler.
Definition in file ubsan.cpp.
| void __ubsan_handle_add_overflow | ( | overflow_info_t * | info | ) |
Triggered when adding beyond the maximum value for the type.
| info | The location and type of the overflow |
Definition at line 139 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::handle(), and MaxOS::runtime::OverflowInfo::location.
| void __ubsan_handle_builtin_unreachable | ( | location_only_info_t * | info | ) |
Triggered when reaching code that should be unreachable.
| info | The location of the unreachable code |
Definition at line 172 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::handle(), and MaxOS::runtime::LocationOnlyInfo::location.
| void __ubsan_handle_divrem_overflow | ( | overflow_info_t * | info | ) |
Triggered when dividing or taking the remainder results in an overflow (eg dividing INT_MIN by -1)
| info | The location and type of the overflow |
Definition at line 150 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::handle(), and MaxOS::runtime::OverflowInfo::location.
| void __ubsan_handle_load_invalid_value | ( | invalid_value_info_t * | info | ) |
Triggered when loading a value that is invalid for its type (eg corrupted or uninitialised)
| info | The location and type of the invalid value |
Definition at line 194 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::handle(), and MaxOS::runtime::InvaildValueInfo::location.
| void __ubsan_handle_missing_return | ( | location_only_info_t * | info | ) |
Triggered when a function that is expected to return a value does not.
| info | The location of the missing return |
Definition at line 205 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::handle(), and MaxOS::runtime::LocationOnlyInfo::location.
| void __ubsan_handle_mul_overflow | ( | overflow_info_t * | info | ) |
Triggered when multiplying beyond the maximum value for the type.
| info | The location and type of the overflow |
Definition at line 183 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::handle(), and MaxOS::runtime::OverflowInfo::location.
| void __ubsan_handle_negate_overflow | ( | overflow_info_t * | info | ) |
Triggered when negating (taking -x) when there is no corresponding positive/negative value.
| info | The location and type of the overflow |
Definition at line 161 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::handle(), and MaxOS::runtime::OverflowInfo::location.
| void __ubsan_handle_out_of_bounds | ( | out_of_bounds_info_t * | info | ) |
Triggered when accessing an array at an index larger than its size (or negative)
| info | The location and type of the out of bounds access |
Definition at line 128 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::handle(), and MaxOS::runtime::OutOfBoundsInfo::location.
| void __ubsan_handle_pointer_overflow | ( | overflow_info_t * | info | ) |
Triggered when adding/subbing to a memory address is outside the expected bounds.
| info | The overflow information |
Definition at line 96 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::handle(), and MaxOS::runtime::OverflowInfo::location.
| void __ubsan_handle_shift_out_of_bounds | ( | shift_out_of_bounds_info_t * | info | ) |
Triggered when shifting beyond the capacity of the type.
| info | The shift out of bounds information |
Definition at line 118 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::handle(), and MaxOS::runtime::ShiftOutOfBoundsInfo::location.
| void __ubsan_handle_sub_overflow | ( | overflow_info_t * | info | ) |
Triggered when subtracting below the minimum value for the type.
| info | The location and type of the overflow |
Definition at line 107 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::handle(), and MaxOS::runtime::OverflowInfo::location.
| void __ubsan_handle_type_mismatch | ( | type_mismatch_info_t * | info, |
| uintptr_t | ptr | ||
| ) |
Triggered when memory is accessed with an unexpected type.
| info | The mismatch between the two types |
| ptr | The pointer to where the type mismatch occurred |
Definition at line 75 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::print_type_mismatch().
| void __ubsan_handle_type_mismatch_v1 | ( | type_mismatch_info_v1_t * | info, |
| uintptr_t | ptr | ||
| ) |
Triggered when memory is accessed with an unexpected type (UBSan v1 - includes more metadata)
| info | The mismatch between the two types |
| ptr | The pointer to where the type mismatch occurred |
Definition at line 86 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::print_type_mismatch_v1().
| void __ubsan_handle_vla_bound_not_positive | ( | vla_bound_not_positive_info_t * | info | ) |
Triggered when a variable length array (VLA) is declared with a non-positive bound.
| info | The location and type of the VLA bound |
Definition at line 215 of file ubsan.cpp.
References MaxOS::runtime::UBSanHandler::handle(), and MaxOS::runtime::VLABoundNotPositiveInfo::location.