chore(deps): bump wazero to latest main (#2436)

also fixes a redundant close

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Crypt Keeper
2022-07-03 23:52:37 +08:00
committed by GitHub
parent 581fe1ed55
commit f0720f3ce5
3 changed files with 5 additions and 18 deletions

View File

@@ -9,7 +9,6 @@ import (
"path/filepath"
"regexp"
"github.com/hashicorp/go-multierror"
"github.com/liamg/memoryfs"
"github.com/mailru/easyjson"
"github.com/samber/lo"
@@ -145,16 +144,7 @@ func (m *Manager) Register() {
}
func (m *Manager) Close(ctx context.Context) error {
var errs error
if err := m.runtime.Close(ctx); err != nil {
errs = multierror.Append(errs, err)
}
for _, p := range m.modules {
if err := p.Close(ctx); err != nil {
errs = multierror.Append(errs, err)
}
}
return errs
return m.runtime.Close(ctx)
}
func splitPtrSize(u uint64) (uint32, uint32) {
@@ -412,10 +402,7 @@ func (m *wasmModule) Analyze(ctx context.Context, input analyzer.AnalysisInput)
}
// Pass memory fs to the analyze() function
ctx, closer, err := experimental.WithFS(ctx, memfs)
if err != nil {
return nil, xerrors.Errorf("fs error: %w", err)
}
ctx, closer := experimental.WithFS(ctx, memfs)
defer closer.Close(ctx)
inputPtr, inputSize, err := stringToPtrSize(ctx, filePath, m.mod, m.malloc)