From 348565b6a9a823c0fee30c96d8d783810d540a78 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 13 May 2016 11:20:28 -0700 Subject: Fix the maximum memory size to be valid. (#492) --- src/wasm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/wasm.h') 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 segments; Name exportName; - Memory() : initial(0), max(-1U) {} + Memory() : initial(0), max(kMaxSize) {} }; class Module { -- cgit v1.2.3