summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2018-06-05 11:39:25 -0700
committerGitHub <noreply@github.com>2018-06-05 11:39:25 -0700
commitf0d1c31121d40d958fc94c9bbcaa1a5feacc923a (patch)
treeb08678420505df692844e5ce510198ecf8525b27
parent465b18b4a1f9c0d44d927d22a1291ca89c29a896 (diff)
downloadbinaryen-f0d1c31121d40d958fc94c9bbcaa1a5feacc923a.tar.gz
binaryen-f0d1c31121d40d958fc94c9bbcaa1a5feacc923a.tar.bz2
binaryen-f0d1c31121d40d958fc94c9bbcaa1a5feacc923a.zip
Ensure import and function names match during fixInvokeFunctionNames (#1587)
We ran into an issue recently where wasm-emscripten-finalize was being passed input without any debug names and this is not currently supported.
-rw-r--r--src/wasm/wasm-emscripten.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wasm/wasm-emscripten.cpp b/src/wasm/wasm-emscripten.cpp
index 3b658c3ff..637711765 100644
--- a/src/wasm/wasm-emscripten.cpp
+++ b/src/wasm/wasm-emscripten.cpp
@@ -584,10 +584,14 @@ struct FixInvokeFunctionNamesWalker : public PostWalker<FixInvokeFunctionNamesWa
return;
FunctionType* func = wasm.getFunctionType(curr->functionType);
- Name newname = fixEmEHSjLjNames(curr->name, getSig(func));
+ Name newname = fixEmEHSjLjNames(curr->base, getSig(func));
if (newname == curr->name)
return;
+ if (curr->base != curr->name) {
+ Fatal() << "Import name and function name do not match: '" << curr->base << "' '" << curr->name << "'";
+ }
+
assert(importRenames.count(curr->name) == 0);
importRenames[curr->name] = newname;
// Either rename of remove the existing import