![]() |
Max OS 0.3
|
Handles undefined behaviour sanitizer runtime errors. More...
#include <ubsan.h>
Static Public Member Functions | |
| static void | handle (source_location_t location, const char *msg) |
| Handles the UBSan error (currently only printing the location and panicking) | |
| static void | print_type_mismatch (type_mismatch_info_t *info, uintptr_t ptr) |
| Prints the type mismatch error for UBSan. | |
| static void | print_type_mismatch_v1 (type_mismatch_info_v1_t *info, uintptr_t ptr) |
| Prints the type mismatch error for UBSan v1. | |
|
static |
Handles the UBSan error (currently only printing the location and panicking)
| location | The location of the error |
| msg | The message that informs about the error |
Definition at line 25 of file ubsan.cpp.
References ASSERT, MaxOS::runtime::SourceLocation::column, MaxOS::runtime::SourceLocation::file, and MaxOS::runtime::SourceLocation::line.
Referenced by __ubsan_handle_add_overflow(), __ubsan_handle_builtin_unreachable(), __ubsan_handle_divrem_overflow(), __ubsan_handle_load_invalid_value(), __ubsan_handle_missing_return(), __ubsan_handle_mul_overflow(), __ubsan_handle_negate_overflow(), __ubsan_handle_out_of_bounds(), __ubsan_handle_pointer_overflow(), __ubsan_handle_shift_out_of_bounds(), __ubsan_handle_sub_overflow(), __ubsan_handle_vla_bound_not_positive(), print_type_mismatch(), and print_type_mismatch_v1().
|
static |
Prints the type mismatch error for UBSan.
| info | The type mismatch info |
| ptr | The pointer to the object |
Definition at line 37 of file ubsan.cpp.
References MaxOS::runtime::TypeMismatchInfo::alignment, handle(), MaxOS::runtime::TypeMismatchInfo::location, MaxOS::runtime::TypeDescriptor::name, MaxOS::runtime::TypeMismatchInfo::type, MaxOS::runtime::TypeMismatchInfo::type_check_kind, MaxOS::runtime::TYPE_CHECK_KINDS, and ubsan_aligned.
Referenced by __ubsan_handle_type_mismatch().
|
static |
Prints the type mismatch error for UBSan v1.
| info | The type mismatch info |
| ptr | The pointer to the object |
Definition at line 56 of file ubsan.cpp.
References handle(), MaxOS::runtime::TypeMismatchInfoV1::location, MaxOS::runtime::TypeMismatchInfoV1::log_alignment, MaxOS::runtime::TypeDescriptor::name, MaxOS::runtime::TypeMismatchInfoV1::type, MaxOS::runtime::TypeMismatchInfoV1::type_check_kind, MaxOS::runtime::TYPE_CHECK_KINDS, and ubsan_aligned.
Referenced by __ubsan_handle_type_mismatch_v1().