Index: src/wasm/wasm-module.cc |
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc |
index 3a4ac2dbef552e48cb2562ed785b3c3120a403b5..07addae634a15a0535e4c23866f0db8868c581b6 100644 |
--- a/src/wasm/wasm-module.cc |
+++ b/src/wasm/wasm-module.cc |
@@ -1546,6 +1546,9 @@ class WasmInstanceBuilder { |
uint32_t source_size = |
static_cast<uint32_t>(segment->get_int(kSourceSize)); |
+ // TODO(titzer): These should be runtime errors and not CHECKs if |
+ // dest_addr is global (and therefore initialized at linktime to an |
+ // possibly-invalid value). |
CHECK_LT(dest_addr, mem_size); |
CHECK_LE(source_size, mem_size); |
CHECK_LE(dest_addr, mem_size - source_size); |