summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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