summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2022-03-19 22:26:18 +0330
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-03-20 10:44:32 +0330
commit18c5b0f1ccdade06780d7a4d4c44822772f94d69 (patch)
tree5eb57460d1e0039382c356998e2b4cd389e41b10 /Userland/Libraries
parent612d5f201add8ec645fd4f3a043002b90ac670a9 (diff)
downloadserenity-18c5b0f1ccdade06780d7a4d4c44822772f94d69.zip
LibWasm: Allow Limits max value to be equal to 2^k-1
That value fits in k bits, so we should allow it.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp b/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp
index 076d4e5b3e..bd611a5243 100644
--- a/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp
+++ b/Userland/Libraries/LibWasm/AbstractMachine/Validator.cpp
@@ -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()))