summaryrefslogtreecommitdiff
path: root/src/wasm.h
diff options
context:
space:
mode:
authorDan Gohman <sunfish@mozilla.com>2016-05-13 11:20:28 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-05-13 11:20:28 -0700
commit348565b6a9a823c0fee30c96d8d783810d540a78 (patch)
treeabb41a1a8220d5631003fa3b0b72a1060f09bd62 /src/wasm.h
parent4a720eca42c463d53db1c81f9957a3e5d9011836 (diff)
downloadbinaryen-348565b6a9a823c0fee30c96d8d783810d540a78.tar.gz
binaryen-348565b6a9a823c0fee30c96d8d783810d540a78.tar.bz2
binaryen-348565b6a9a823c0fee30c96d8d783810d540a78.zip
Fix the maximum memory size to be valid. (#492)
Diffstat (limited to 'src/wasm.h')
-rw-r--r--src/wasm.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wasm.h b/src/wasm.h
index 327be9c7e..56e74f372 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -1281,6 +1281,7 @@ public:
class Memory {
public:
static const Address::address_t kPageSize = 64 * 1024;
+ static const Address::address_t kMaxSize = ~Address::address_t(0) / kPageSize;
static const Address::address_t kPageMask = ~(kPageSize - 1);
struct Segment {
Address offset;
@@ -1299,7 +1300,7 @@ public:
std::vector<Segment> segments;
Name exportName;
- Memory() : initial(0), max(-1U) {}
+ Memory() : initial(0), max(kMaxSize) {}
};
class Module {