forked from Bananymous/banan-os
Kenrel: Add __builtin_unreachable support for UBSAN
This commit is contained in:
parent
d59463d11b
commit
60d5257678
|
@ -75,6 +75,11 @@ extern "C"
|
||||||
builtin_check_kind kind;
|
builtin_check_kind kind;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct unreachable_data
|
||||||
|
{
|
||||||
|
struct source_location location;
|
||||||
|
};
|
||||||
|
|
||||||
using value_handle = uintptr_t;
|
using value_handle = uintptr_t;
|
||||||
|
|
||||||
static const char* type_check_kinds[] = {
|
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_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)
|
void __ubsan_handle_type_mismatch_v1(type_mismatch_data* data, value_handle pointer)
|
||||||
{
|
{
|
||||||
print_location(data->location);
|
print_location(data->location);
|
||||||
|
|
Loading…
Reference in New Issue