Skip to content

Commit baa8b95

Browse files
committed
std::numeric_limits
1 parent 270292b commit baa8b95

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/wasm/wasm-validator.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3465,8 +3465,9 @@ void FunctionValidator::visitFunction(Function* curr) {
34653465
void FunctionValidator::validateOffset(Address offset,
34663466
Memory* mem,
34673467
Expression* curr) {
3468-
shouldBeTrue(
3469-
mem->is64() || offset < (1ull << 32), curr, "offset must be u32");
3468+
shouldBeTrue(mem->is64() || offset <= std::numeric_limits<uint32_t>::max(),
3469+
curr,
3470+
"offset must be u32");
34703471
}
34713472

34723473
void FunctionValidator::validateAlignment(

0 commit comments

Comments
 (0)