Holds function types as values, not ptrs in wasm.Module (#1227)

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
Takeshi Yoneda
2023-03-14 21:45:52 -07:00
committed by GitHub
parent aba4ede088
commit 350e81e632
38 changed files with 447 additions and 442 deletions

View File

@@ -59,7 +59,7 @@ func TestNewHostModule(t *testing.T) {
},
},
expected: &Module{
TypeSection: []*FunctionType{
TypeSection: []FunctionType{
{Params: []ValueType{i32, i32}, Results: []ValueType{i32}},
{Params: []ValueType{i32, i32, i32, i32}, Results: []ValueType{i32}},
},
@@ -102,7 +102,7 @@ func TestNewHostModule(t *testing.T) {
},
funcToNames: map[string]*HostFuncNames{swapName: {}},
expected: &Module{
TypeSection: []*FunctionType{{Params: []ValueType{i32, i32}, Results: []ValueType{i32, i32}}},
TypeSection: []FunctionType{{Params: []ValueType{i32, i32}, Results: []ValueType{i32, i32}}},
FunctionSection: []Index{0},
CodeSection: []*Code{MustParseGoReflectFuncCode(swap)},
ExportSection: []Export{{Name: "swap", Type: ExternTypeFunc, Index: 0}},