Index: src/assembler.cc |
diff --git a/src/assembler.cc b/src/assembler.cc |
index ffd15d105f60ce4a24aeec41e5e1e466d0349079..b44bc06ba36aaff6cbd92c6a6f9a1f928e0f35a7 100644 |
--- a/src/assembler.cc |
+++ b/src/assembler.cc |
@@ -351,7 +351,9 @@ |
icache_flush_mode); |
} else if (IsWasmMemorySizeReference(rmode_)) { |
uint32_t current_size_reference = wasm_memory_size_reference(); |
+ DCHECK(old_size == 0 || current_size_reference <= old_size); |
uint32_t offset = old_size - current_size_reference; |
+ DCHECK_GE(new_size, offset); |
uint32_t updated_size_reference = new_size - offset; |
unchecked_update_wasm_memory_size(updated_size_reference, |
icache_flush_mode); |