summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm-binary.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index d2959c69d..aea31233d 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -390,8 +390,8 @@ public:
void writeMemory() {
if (wasm->memory.max == 0) return;
if (debug) std::cerr << "== writeMemory" << std::endl;
- o << int8_t(BinaryConsts::Memory) << int8_t(log2(wasm->memory.initial))
- << int8_t(log2(wasm->memory.max))
+ o << int8_t(BinaryConsts::Memory) << int8_t(ceil(log2(wasm->memory.initial)))
+ << int8_t(ceil(log2(wasm->memory.max)))
<< int8_t(1); // export memory
}