diff options
author | Sam Clegg <sbc@chromium.org> | 2018-06-05 11:39:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-05 11:39:25 -0700 |
commit | f0d1c31121d40d958fc94c9bbcaa1a5feacc923a (patch) | |
tree | b08678420505df692844e5ce510198ecf8525b27 /src | |
parent | 465b18b4a1f9c0d44d927d22a1291ca89c29a896 (diff) | |
download | binaryen-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.
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm/wasm-emscripten.cpp | 6 |
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 |