Index: src/compiler/wasm-compiler.cc |
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc |
index 9ff174d3a7d305290ad994617afefb9e14aabdd7..c52b45269229296c1b93a7fbb31e3f945aa64c13 100644 |
--- a/src/compiler/wasm-compiler.cc |
+++ b/src/compiler/wasm-compiler.cc |
@@ -2148,9 +2148,11 @@ Node* WasmGraphBuilder::CallIndirect(uint32_t index, Node** args, Node*** rets, |
Int32Constant(kPointerSizeLog2)), |
Int32Constant(fixed_offset)), |
*effect_, *control_); |
+ int32_t key = module_->module->function_tables[0].map.Find(sig); |
+ DCHECK_GE(key, 0); |
Node* sig_match = |
graph()->NewNode(machine->Word32Equal(), |
- BuildChangeSmiToInt32(load_sig), Int32Constant(index)); |
+ BuildChangeSmiToInt32(load_sig), Int32Constant(key)); |
trap_->AddTrapIfFalse(wasm::kTrapFuncSigMismatch, sig_match, position); |
} |