From 54e4ab81dc6cad2a73a6b27462baed278db38e19 Mon Sep 17 00:00:00 2001 From: Jeroen Bobbeldijk Date: Fri, 29 Sep 2023 10:28:01 +0200 Subject: [PATCH] Fix import check on optimized builds --- wazero.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wazero.go b/wazero.go index ed6423f..660bd43 100644 --- a/wazero.go +++ b/wazero.go @@ -43,7 +43,8 @@ func (e unexportedFunctionError) Error() string { func (e functionExporter) GetImportedFunction(name string) api.FunctionDefinition { importedFunctions := e.guest.ImportedFunctions() for i := range importedFunctions { - if importedFunctions[i].Name() == name { + module, importName, _ := importedFunctions[i].Import() + if module == "env" && importName == name { return importedFunctions[i] } }