diff options
author | Alon Zakai <alonzakai@gmail.com> | 2019-01-29 12:39:02 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-29 12:39:02 -0800 |
commit | 5f1afa58d22dce1088c63eff690283d8c615feee (patch) | |
tree | 6c59a39af79f789f1c65d00c72a960f222b9f845 /src/wasm | |
parent | 5bfb98b97c18342d851d2e0841a3091ae671f88c (diff) | |
download | binaryen-5f1afa58d22dce1088c63eff690283d8c615feee.tar.gz binaryen-5f1afa58d22dce1088c63eff690283d8c615feee.tar.bz2 binaryen-5f1afa58d22dce1088c63eff690283d8c615feee.zip |
wasm-emscripten-finalize: Emit illegal dynCalls, and legalize them (#1890)
Before this, we just did not emit illegal dynCalls. This was wrong as we do need them (e.g. if a function with a setjmp call calls a function with an i64 param - we'll have an invoke with that signature there). We just need to legalize them. This fixes that by first emitting them, and second by running legalization late, after dynCalls have been generated, so it legalizes them too.
Diffstat (limited to 'src/wasm')
-rw-r--r-- | src/wasm/wasm-emscripten.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp index 3dee642b1..e09ad98d2 100644 --- a/src/wasm/wasm-emscripten.cpp +++ b/src/wasm/wasm-emscripten.cpp @@ -161,14 +161,6 @@ void EmscriptenGlueGenerator::generateStackInitialization(Address addr) { stackPointer->init->cast<Const>()->value = Literal(int32_t(addr)); } -static bool hasI64ResultOrParam(FunctionType* ft) { - if (ft->result == i64) return true; - for (auto ty : ft->params) { - if (ty == i64) return true; - } - return false; -} - inline void exportFunction(Module& wasm, Name name, bool must_export) { if (!wasm.getFunctionOrNull(name)) { assert(!must_export); @@ -194,7 +186,6 @@ void EmscriptenGlueGenerator::generateDynCallThunks() { } std::string sig = getSig(wasm.getFunction(indirectFunc)); auto* funcType = ensureFunctionType(sig, &wasm); - if (hasI64ResultOrParam(funcType)) continue; // Can't export i64s on the web. if (!sigs.insert(sig).second) continue; // Sig is already in the set std::vector<NameType> params; params.emplace_back("fptr", i32); // function pointer param |