Skip to content

Commit

Permalink
std::numeric_limits
Browse files Browse the repository at this point in the history
  • Loading branch information
tlively committed Nov 25, 2024
1 parent 1056129 commit 988b037
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/wasm-interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -3836,8 +3836,9 @@ class ModuleRunnerBase : public ExpressionRunner<SubType> {
auto fail = Literal::makeFromInt64(-1, memory->addressType);
Flow ret = Literal::makeFromInt64(memorySize, addressType);
uint64_t delta = flow.getSingleValue().getUnsigned();
uint64_t maxAddr =
addressType == Type::i32 ? uint64_t(uint32_t(-1)) : uint64_t(-1);
uint64_t maxAddr = addressType == Type::i32
? std::numeric_limits<uint32_t>::max()
: std::numeric_limits<uint64_t>::max();
if (delta > maxAddr / Memory::kPageSize) {
// Impossible to grow this much.
return fail;
Expand Down

0 comments on commit 988b037

Please sign in to comment.