ir: rename NeedsAccess* -> Has*, and make them module-scoped (#699)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
@@ -17,6 +17,8 @@ var (
|
||||
case695 []byte
|
||||
//go:embed testdata/696.wasm
|
||||
case696 []byte
|
||||
//go:embed testdata/699.wasm
|
||||
case699 []byte
|
||||
)
|
||||
|
||||
func newRuntimeCompiler() wazero.Runtime {
|
||||
@@ -87,3 +89,26 @@ func Test696(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Test699 ensures that accessing element instances and data instances works
|
||||
// without crash even when the access happens in the nested function call.
|
||||
func Test699(t *testing.T) {
|
||||
if !platform.CompilerSupported() {
|
||||
return
|
||||
}
|
||||
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
r wazero.Runtime
|
||||
}{
|
||||
{name: "compiler", r: newRuntimeCompiler()},
|
||||
{name: "interpreter", r: newRuntimeInterpreter()},
|
||||
} {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
defer tc.r.Close(ctx)
|
||||
_, err := tc.r.InstantiateModuleFromBinary(ctx, case699)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user