1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

LibWasm: Allow Limits max value to be equal to 2^k-1

That value fits in k bits, so we should allow it.
This commit is contained in:
Ali Mohammad Pur 2022-03-19 22:26:18 +03:30 committed by Ali Mohammad Pur
parent 612d5f201a
commit 18c5b0f1cc

View file

@ -305,7 +305,7 @@ ErrorOr<void, ValidationError> Validator::validate(Limits const& limits, size_t
{
auto bound = (1ull << k) - 1;
auto check_bound = [bound](auto value) {
return static_cast<u64>(value) < bound;
return static_cast<u64>(value) <= bound;
};
if (!check_bound(limits.min()))