summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/passes/MemoryPacking.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/passes/MemoryPacking.cpp b/src/passes/MemoryPacking.cpp
index 18207026a..98c7cce00 100644
--- a/src/passes/MemoryPacking.cpp
+++ b/src/passes/MemoryPacking.cpp
@@ -140,7 +140,12 @@ struct MemoryPacking : public Pass {
builder.makeBinary(
OrInt32,
builder.makeBinary(
- GtUInt32, curr->dest, builder.makeHost(MemorySize, Name(), {})),
+ GtUInt32,
+ curr->dest,
+ builder.makeBinary(
+ MulInt32,
+ builder.makeConst(Literal(Memory::kPageSize)),
+ builder.makeHost(MemorySize, Name(), {}))),
builder.makeBinary(OrInt32, curr->offset, curr->size)),
builder.makeUnreachable()));
changed = true;