diff options
Diffstat (limited to 'src/tools/wasm-ctor-eval.cpp')
-rw-r--r-- | src/tools/wasm-ctor-eval.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/tools/wasm-ctor-eval.cpp b/src/tools/wasm-ctor-eval.cpp index 4ad9979cd..9e3915073 100644 --- a/src/tools/wasm-ctor-eval.cpp +++ b/src/tools/wasm-ctor-eval.cpp @@ -215,14 +215,23 @@ struct CtorEvalExternalInterface : EvallingModuleInstance::ExternalInterface { extra); } - Literals callTable(Index index, + Literals callTable(Name tableName, + Index index, Signature sig, LiteralList& arguments, Type result, EvallingModuleInstance& instance) override { + + std::unordered_map<wasm::Name, std::vector<wasm::Name>>::iterator it; + + auto* table = wasm->getTableOrNull(tableName); + if (!table) { + throw FailToEvalException("callTable on non-existing table"); + } + // we assume the table is not modified (hmm) // look through the segments, try to find the function - for (auto& segment : wasm->table.segments) { + for (auto& segment : table->segments) { Index start; // look for the index in this segment. if it has a constant offset, we // look in the proper range. if it instead gets a global, we rely on the @@ -282,7 +291,7 @@ struct CtorEvalExternalInterface : EvallingModuleInstance::ExternalInterface { } // called during initialization, but we don't keep track of a table - void tableStore(Address addr, Name value) override {} + void tableStore(Name tableName, Address addr, Name value) override {} bool growMemory(Address /*oldSize*/, Address newSize) override { throw FailToEvalException("grow memory"); |