mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Make TypeBoundsChecker<UnsignedIntegralT, FloatingPointT> work
By replacing MakeUnsigned<Source> in this specific specialization with a simple negativity check this now works for floating point source types. Previously it would attempt a comparison of the destination type and void.
This commit is contained in:
parent
8f26f51580
commit
42b6bffbf2
Notes:
sideshowbarker
2024-07-18 08:33:35 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/42b6bffbf2b Pull-request: https://github.com/SerenityOS/serenity/pull/8940 Reviewed-by: https://github.com/IdanHo ✅
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ template<typename Destination, typename Source>
|
|||
struct TypeBoundsChecker<Destination, Source, false, false, true> {
|
||||
static constexpr bool is_within_range(Source value)
|
||||
{
|
||||
return static_cast<MakeUnsigned<Source>>(value) <= NumericLimits<Destination>::max();
|
||||
return value >= 0 && value <= NumericLimits<Destination>::max();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue