Index: src/compiler/wasm-compiler.cc |
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc |
index 60fbfbb62c01159818fe57bb31d99e926922abfc..7945457da6bec1c25a7853cf080dec9b4e8e394b 100644 |
--- a/src/compiler/wasm-compiler.cc |
+++ b/src/compiler/wasm-compiler.cc |
@@ -2515,10 +2515,13 @@ Node* WasmGraphBuilder::MemSize(uint32_t offset) { |
DCHECK(module_ && module_->instance); |
uint32_t size = static_cast<uint32_t>(module_->instance->mem_size); |
if (offset == 0) { |
- if (!mem_size_) mem_size_ = jsgraph()->Int32Constant(size); |
+ if (!mem_size_) |
+ mem_size_ = jsgraph()->RelocatableInt32Constant( |
+ size, RelocInfo::WASM_MEMORY_SIZE_REFERENCE); |
return mem_size_; |
} else { |
- return jsgraph()->Int32Constant(size + offset); |
+ return jsgraph()->RelocatableInt32Constant( |
+ size + offset, RelocInfo::WASM_MEMORY_SIZE_REFERENCE); |
} |
} |
@@ -2576,9 +2579,10 @@ void WasmGraphBuilder::BoundsCheckMem(MachineType memtype, Node* index, |
// Check against the limit. |
size_t limit = size - offset - memsize; |
CHECK(limit <= kMaxUInt32); |
- cond = graph()->NewNode( |
- jsgraph()->machine()->Uint32LessThanOrEqual(), index, |
- jsgraph()->Int32Constant(static_cast<uint32_t>(limit))); |
+ cond = graph()->NewNode(jsgraph()->machine()->Uint32LessThanOrEqual(), |
+ index, jsgraph()->RelocatableInt32Constant( |
+ static_cast<uint32_t>(limit), |
+ RelocInfo::WASM_MEMORY_SIZE_REFERENCE)); |
} |
trap_->AddTrapIfFalse(wasm::kTrapMemOutOfBounds, cond); |