summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2019-11-26 14:38:38 -0800
committerGitHub <noreply@github.com>2019-11-26 14:38:38 -0800
commit7665f703f4e3437564be25ae276e1daaedd98d79 (patch)
treea38576f36581144dd167df6e1fe27dd2d5c2fd44 /src
parent2ad71336a9f156a6f33958c96e4c08967f4920ed (diff)
downloadbinaryen-7665f703f4e3437564be25ae276e1daaedd98d79.tar.gz
binaryen-7665f703f4e3437564be25ae276e1daaedd98d79.tar.bz2
binaryen-7665f703f4e3437564be25ae276e1daaedd98d79.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/wasm/wasm-emscripten.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp
index 690ce17d0..3f64bafe8 100644
--- a/src/wasm/wasm-emscripten.cpp
+++ b/src/wasm/wasm-emscripten.cpp
@@ -871,7 +871,9 @@ void AsmConstWalker::queueImport(Name importName, std::string baseSig) {
auto import = new Function;
import->name = import->base = importName;
import->module = ENV;
- import->type = ensureFunctionType(baseSig, &wasm)->name;
+ auto* funcType = ensureFunctionType(baseSig, &wasm);
+ import->type = funcType->name;
+ FunctionTypeUtils::fillFunction(import, funcType);
queuedImports.push_back(std::unique_ptr<Function>(import));
}