Skip to content

Commit d78d229

Browse files
committed
fix
1 parent ce5e7f5 commit d78d229

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

instrumentation/MockInstrumentationWalker.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "MockInstrumentationWalker.hpp"
2+
#include <asmjs/shared-constants.h>
23
#include <binaryen-c.h>
34
#include <string_view>
45
#include <support/index.h>
@@ -90,6 +91,10 @@ bool MockInstrumentationWalker::mockFunctionDuplicateImportedCheck() const noexc
9091

9192
void MockInstrumentationWalker::addExecuteTestFunction() noexcept {
9293
std::vector<BinaryenExpressionRef> operands{};
94+
if (module->tables.empty()) {
95+
auto * table = module->addTable(wasm::Builder::makeTable(wasm::Name::fromInt(0)));
96+
table->base = "__indirect_function_table";
97+
}
9398
BinaryenExpressionRef body = moduleBuilder.makeCallIndirect(
9499
module->tables[0]->name,
95100
BinaryenLocalGet(module, 0, wasm::Type::i32),

0 commit comments

Comments
 (0)