diff options
Diffstat (limited to 'src/shell-interface.h')
-rw-r--r-- | src/shell-interface.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shell-interface.h b/src/shell-interface.h index 4d125ea09..8cb7c2672 100644 --- a/src/shell-interface.h +++ b/src/shell-interface.h @@ -143,7 +143,8 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface { Literal callTable(Index index, LiteralList& arguments, WasmType result, ModuleInstance& instance) override { if (index >= table.size()) trap("callTable overflow"); - auto* func = instance.wasm.getFunction(table[index]); + auto* func = instance.wasm.checkFunction(table[index]); + if (!func) trap("uninitialized table element"); if (func->params.size() != arguments.size()) trap("callIndirect: bad # of arguments"); for (size_t i = 0; i < func->params.size(); i++) { if (func->params[i] != arguments[i].type) { |