mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-14 01:04:38 +03:00
Kernel: And some more KUBSAN checks :^)
Here comes a few more: * enum * object-size * vptr
This commit is contained in:
parent
fad0332898
commit
04ff46bff4
Notes:
sideshowbarker
2024-07-18 22:34:08 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/04ff46bff4b
@ -270,7 +270,7 @@ set(SOURCES
|
||||
${C_SOURCES}
|
||||
)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=nonnull-attribute,bool,vla-bound,signed-integer-overflow,shift,shift-exponent,shift-base,integer-divide-by-zero,return,bounds,bounds-strict")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=nonnull-attribute,bool,vla-bound,signed-integer-overflow,shift,shift-exponent,shift-base,integer-divide-by-zero,return,bounds,bounds-strict,object-size,enum,vptr")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -DKERNEL")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pie -fPIE -fno-rtti -ffreestanding -fbuiltin")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-80387 -mno-mmx -mno-sse -mno-sse2")
|
||||
|
@ -108,4 +108,11 @@ void __ubsan_handle_out_of_bounds(const OutOfBoundsData& data, void*)
|
||||
dbgln("KUBSAN: out of bounds access into array of {} ({}-bit), index type {} ({}-bit)", data.array_type.name(), data.array_type.bit_width(), data.index_type.name(), data.index_type.bit_width());
|
||||
print_location(data.location);
|
||||
}
|
||||
|
||||
void __ubsan_handle_type_mismatch_v1(const TypeMismatchData&, void*);
|
||||
void __ubsan_handle_type_mismatch_v1(const TypeMismatchData& data, void*)
|
||||
{
|
||||
dbgln("KUBSAN: type mismatch, {} ({}-bit)", data.type.name(), data.type.bit_width());
|
||||
print_location(data.location);
|
||||
}
|
||||
}
|
||||
|
@ -96,4 +96,11 @@ struct OutOfBoundsData {
|
||||
const TypeDescriptor& index_type;
|
||||
};
|
||||
|
||||
struct TypeMismatchData {
|
||||
SourceLocation location;
|
||||
const TypeDescriptor& type;
|
||||
u8 log_alignment;
|
||||
u8 type_check_kind;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user