summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/s2wasm.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h
index 649b32196..ac62046d8 100644
--- a/src/s2wasm.h
+++ b/src/s2wasm.h
@@ -399,6 +399,8 @@ class S2WasmBuilder {
void placeStack(size_t stackAllocation) {
// Allocate space for a user stack. It starts zeroed-out so needs no segment
+ // Round to a 16-byte aligned address.
+ nextStatic = (nextStatic + 15) & static_cast<size_t>(-16);
staticAddresses[".stack"] = nextStatic;
nextStatic += stackAllocation;
wasm.memory.initial = nextStatic;