From d8adcc182d69974096063ad57b50e8fec3fcccf8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 18 May 2016 18:45:32 -0700 Subject: be more careful with checking total memory limit on 64-bit --- src/wasm-s-parser.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 42c1ce88e..b59af7215 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -1209,8 +1209,9 @@ private: if (s.size() == 2) return; size_t i = 2; if (s[i]->isStr()) { - wasm.memory.max = atoi(s[i]->c_str()); - if (wasm.memory.max > Memory::kMaxSize) throw ParseException("total memory must be <= 4GB"); + uint64_t max = atoll(s[i]->c_str()); + if (max > Memory::kMaxSize) throw ParseException("total memory must be <= 4GB"); + wasm.memory.max = max; i++; } while (i < s.size()) { -- cgit v1.2.3