Supports functions with multiple results (multi-value) (#446)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
Crypt Keeper
2022-04-13 09:22:39 +08:00
committed by GitHub
parent 927914ffb0
commit c3ff16d596
68 changed files with 5555 additions and 1155 deletions

View File

@@ -247,8 +247,13 @@ func (b *moduleBuilder) Build() (*CompiledCode, error) {
}
}
// TODO: we can use r.enabledFeatures to fail early on things like mutable globals
if module, err := wasm.NewHostModule(b.moduleName, b.nameToGoFunc, b.nameToMemory, b.nameToGlobal); err != nil {
if module, err := wasm.NewHostModule(
b.moduleName,
b.nameToGoFunc,
b.nameToMemory,
b.nameToGlobal,
b.r.enabledFeatures,
); err != nil {
return nil, err
} else {
return &CompiledCode{module: module}, nil