From dfe92af3e85a7d0e558ffbfaa387ac9f9cf0e8ec Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 17 Oct 2017 14:46:27 -0700 Subject: clean up ImportUtils: make getImport return the import (more consistent with other similar APIs) and fix some ctor-evalling handling of imports, which was incorrect - we need to create fake globals when importing globals, not later, which is too late for initialized globals from imports (#1226) --- src/ast/import-utils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ast/import-utils.h') diff --git a/src/ast/import-utils.h b/src/ast/import-utils.h index d12c23182..ff7ca3b83 100644 --- a/src/ast/import-utils.h +++ b/src/ast/import-utils.h @@ -25,13 +25,13 @@ namespace wasm { namespace ImportUtils { // find an import by the module.base that is being imported. // return the internal name - inline Name getImport(Module& wasm, Name module, Name base) { + inline Import* getImport(Module& wasm, Name module, Name base) { for (auto& import : wasm.imports) { if (import->module == module && import->base == base) { - return import->name; + return import.get(); } } - return Name(); + return nullptr; } }; -- cgit v1.2.3