Reduces FunctionDefinition usages (#1419)

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
Takeshi Yoneda
2023-04-30 19:37:43 -07:00
committed by GitHub
parent f3f7352584
commit f47b0d3362
12 changed files with 136 additions and 144 deletions

View File

@@ -84,12 +84,12 @@ func (v *InvokeFunc) Call(ctx context.Context, mod api.Module, stack []uint64) {
// Lookup the table index we will call.
t := m.Tables[0] // Note: Emscripten doesn't use multiple tables
idx, err := m.Engine.LookupFunction(t, typeID, tableOffset)
f, err := m.Engine.LookupFunction(t, typeID, tableOffset)
if err != nil {
panic(err)
}
err = m.Engine.NewFunction(idx).CallWithStack(ctx, stack)
err = f.CallWithStack(ctx, stack)
if err != nil {
panic(err)
}