diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/GenerateDynCalls.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/passes/GenerateDynCalls.cpp b/src/passes/GenerateDynCalls.cpp index a53f1d0de..9669dcdb8 100644 --- a/src/passes/GenerateDynCalls.cpp +++ b/src/passes/GenerateDynCalls.cpp @@ -129,9 +129,8 @@ void GenerateDynCalls::generateDynCallThunk(Signature sig) { } // FIXME: Should the existence of a table be ensured here? i.e. create one if // there is none? - Expression* call = - builder.makeCallIndirect(Name::fromInt(0), fptr, args, sig); - f->body = call; + assert(wasm->tables.size() > 0); + f->body = builder.makeCallIndirect(wasm->tables[0]->name, fptr, args, sig); wasm->addFunction(std::move(f)); exportFunction(*wasm, name, true); |