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
commit 18c5b0f1cc
Notes: sideshowbarker 2024-07-17 17:04:02 +09:00

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()))