Kenrel: Add __builtin_unreachable support for UBSAN

This commit is contained in:
Bananymous 2024-09-22 17:14:36 +03:00
parent d59463d11b
commit 60d5257678
1 changed files with 7 additions and 0 deletions

View File

@ -75,6 +75,11 @@ extern "C"
builtin_check_kind kind;
};
struct unreachable_data
{
struct source_location location;
};
using value_handle = uintptr_t;
static const char* type_check_kinds[] = {
@ -114,6 +119,8 @@ extern "C"
HANDLER(__ubsan_handle_invalid_builtin, false, invalid_builtin_data* data);
HANDLER(__ubsan_handle_builtin_unreachable, true, unreachable_data* data);
void __ubsan_handle_type_mismatch_v1(type_mismatch_data* data, value_handle pointer)
{
print_location(data->location);