diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-05-18 18:45:32 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-05-18 18:56:14 -0700 |
commit | d8adcc182d69974096063ad57b50e8fec3fcccf8 (patch) | |
tree | 7e82b32d21802294e0f763e68e9d7f982079af17 /src | |
parent | 013644bd98de23f0e1c303dd72994956486b455a (diff) | |
download | binaryen-d8adcc182d69974096063ad57b50e8fec3fcccf8.tar.gz binaryen-d8adcc182d69974096063ad57b50e8fec3fcccf8.tar.bz2 binaryen-d8adcc182d69974096063ad57b50e8fec3fcccf8.zip |
be more careful with checking total memory limit on 64-bit
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-s-parser.h | 5 |
1 files changed, 3 insertions, 2 deletions
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()) { |