diff options
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()) { |