mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
LibSanitizer+AK: Add float cast overflow handler
This is not enabled by default in GCC, but is in Clang.
This commit is contained in:
parent
e04d20ec20
commit
653d22e21f
Notes:
sideshowbarker
2024-07-18 07:15:42 +09:00
Author: https://github.com/BertalanD
Commit: 653d22e21f
Pull-request: https://github.com/SerenityOS/serenity/pull/8718
Issue: https://github.com/SerenityOS/serenity/issues/363
Reviewed-by: https://github.com/gunnarbeutner ✅
Reviewed-by: https://github.com/nico
2 changed files with 13 additions and 0 deletions
|
@ -117,4 +117,10 @@ struct PointerOverflowData {
|
||||||
SourceLocation location;
|
SourceLocation location;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct FloatCastOverflowData {
|
||||||
|
SourceLocation location;
|
||||||
|
TypeDescriptor const& from_type;
|
||||||
|
TypeDescriptor const& to_type;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,4 +231,11 @@ void __ubsan_handle_pointer_overflow(const PointerOverflowData& data, ValueHandl
|
||||||
}
|
}
|
||||||
print_location(data.location);
|
print_location(data.location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __ubsan_handle_float_cast_overflow(const FloatCastOverflowData&, ValueHandle) __attribute__((used));
|
||||||
|
void __ubsan_handle_float_cast_overflow(const FloatCastOverflowData& data, ValueHandle)
|
||||||
|
{
|
||||||
|
WARNLN_AND_DBGLN("UBSAN: overflow when casting from {} to {}", data.from_type.name(), data.to_type.name());
|
||||||
|
print_location(data.location);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue