diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 568d3138480..81531e27c13 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -3836,8 +3836,9 @@ class ModuleRunnerBase : public ExpressionRunner { 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::max() + : std::numeric_limits::max(); if (delta > maxAddr / Memory::kPageSize) { // Impossible to grow this much. return fail;