Adds MemoryDefinition to CompiledModule and Memory (#817)
It is more often the case that projects are enabling a freestanding target, and that may or may not have an exporting memory depending on how that's interpreted. This adds the ability to inspect memories similar to how you can already inspect compiled code prior to instantiation. For example, you can enforce an ABI constraint that "memory" must be exported even if WASI is not in use. Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -787,7 +787,7 @@ func TestModule_buildFunctions(t *testing.T) {
|
||||
instance := &ModuleInstance{Name: "counter", TypeIDs: []FunctionTypeID{0}}
|
||||
instance.BuildFunctions(m, nil)
|
||||
for i, f := range instance.Functions {
|
||||
require.Equal(t, i, f.FunctionDefinition.Index())
|
||||
require.Equal(t, i, f.Definition.Index())
|
||||
require.Equal(t, nopCode.Body, f.Body)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user