diff --git a/compiler/gen_wasm/src/backend.rs b/compiler/gen_wasm/src/backend.rs index d3f91e4924..0be9371358 100644 --- a/compiler/gen_wasm/src/backend.rs +++ b/compiler/gen_wasm/src/backend.rs @@ -126,7 +126,8 @@ impl<'a> WasmBackend<'a> { init: ConstExpr::I32(stack_heap_boundary as i32), }); - module.memory = MemorySection::new(env.arena, stack_heap_boundary); + module.memory = + MemorySection::new(env.arena, stack_heap_boundary + MemorySection::PAGE_SIZE); module.export.append(Export { name: MEMORY_NAME, ty: ExportType::Mem,