| Index: src/compiler/wasm-compiler.cc
|
| diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
|
| index 2edd72dee57fbc8630f522cdef1b82280df6ad4d..73148badd29b5eb863a1ad51d6fb5e0a86c84fbe 100644
|
| --- a/src/compiler/wasm-compiler.cc
|
| +++ b/src/compiler/wasm-compiler.cc
|
| @@ -2512,10 +2512,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);
|
| }
|
| }
|
|
|
| @@ -2573,9 +2576,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);
|
|
|