Skip to content

Commit 7665f70

Browse files
authored
Update type information for em_asm functions (#2480)
We were only updating the imported Function's type name field and failing to update its params and results. This caused the binary writer to start using the wrong types after #2466. This PR fixes the code to update both type representations on the imported function. This double bookkeeping will be removed entirely in an upcoming PR.
1 parent 2ad7133 commit 7665f70

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/wasm/wasm-emscripten.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,9 @@ void AsmConstWalker::queueImport(Name importName, std::string baseSig) {
871871
auto import = new Function;
872872
import->name = import->base = importName;
873873
import->module = ENV;
874-
import->type = ensureFunctionType(baseSig, &wasm)->name;
874+
auto* funcType = ensureFunctionType(baseSig, &wasm);
875+
import->type = funcType->name;
876+
FunctionTypeUtils::fillFunction(import, funcType);
875877
queuedImports.push_back(std::unique_ptr<Function>(import));
876878
}
877879

0 commit comments

Comments
 (0)