mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07:35 +00:00
Kernel: KUBSAN implementation of returns-nonnull-attribute
This didn't find anything in the current source.
This commit is contained in:
parent
57e10eadac
commit
c95d48c8d6
3 changed files with 12 additions and 1 deletions
|
@ -270,7 +270,7 @@ set(SOURCES
|
||||||
${C_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,object-size,enum,vptr")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=nonnull-attribute,returns-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} -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} -pie -fPIE -fno-rtti -ffreestanding -fbuiltin")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-80387 -mno-mmx -mno-sse -mno-sse2")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-80387 -mno-mmx -mno-sse -mno-sse2")
|
||||||
|
|
|
@ -53,6 +53,13 @@ void __ubsan_handle_nonnull_arg(const NonnullArgData& data)
|
||||||
print_location(data.location);
|
print_location(data.location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __ubsan_handle_nonnull_return_v1(const NonnullReturnData&, const SourceLocation&);
|
||||||
|
void __ubsan_handle_nonnull_return_v1(const NonnullReturnData&, const SourceLocation& location)
|
||||||
|
{
|
||||||
|
dbgln("KUBSAN: null pointer return from function declared to never return null");
|
||||||
|
print_location(location);
|
||||||
|
}
|
||||||
|
|
||||||
void __ubsan_handle_vla_bound_not_positive(const VLABoundData&, void*);
|
void __ubsan_handle_vla_bound_not_positive(const VLABoundData&, void*);
|
||||||
void __ubsan_handle_vla_bound_not_positive(const VLABoundData& data, void*)
|
void __ubsan_handle_vla_bound_not_positive(const VLABoundData& data, void*)
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,6 +74,10 @@ struct NonnullArgData {
|
||||||
int argument_index;
|
int argument_index;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct NonnullReturnData {
|
||||||
|
SourceLocation attribute_location;
|
||||||
|
};
|
||||||
|
|
||||||
struct OverflowData {
|
struct OverflowData {
|
||||||
SourceLocation location;
|
SourceLocation location;
|
||||||
const TypeDescriptor& type;
|
const TypeDescriptor& type;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue