mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +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:
parent
612d5f201a
commit
18c5b0f1cc
Notes:
sideshowbarker
2024-07-17 17:04:02 +09:00
Author: https://github.com/alimpfard
Commit: 18c5b0f1cc
Pull-request: https://github.com/SerenityOS/serenity/pull/13142
Reviewed-by: https://github.com/ADKaster
1 changed files with 1 additions and 1 deletions
|
@ -305,7 +305,7 @@ ErrorOr<void, ValidationError> Validator::validate(Limits const& limits, size_t
|
||||||
{
|
{
|
||||||
auto bound = (1ull << k) - 1;
|
auto bound = (1ull << k) - 1;
|
||||||
auto check_bound = [bound](auto value) {
|
auto check_bound = [bound](auto value) {
|
||||||
return static_cast<u64>(value) < bound;
|
return static_cast<u64>(value) <= bound;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!check_bound(limits.min()))
|
if (!check_bound(limits.min()))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue