summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tools/wasm-reduce.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp
index b36891d5b..29218de6f 100644
--- a/src/tools/wasm-reduce.cpp
+++ b/src/tools/wasm-reduce.cpp
@@ -890,9 +890,10 @@ struct Reducer
if (names.size() == 0) {
continue;
}
- // Try to remove functions, and if that fails, try to at least empty out
- // their bodies.
- justReduced = tryToRemoveFunctions(names) || tryToEmptyFunctions(names);
+ // Try to remove functions and/or empty them. Note that
+ // tryToRemoveFunctions() will reload the module if it fails, which means
+ // function names may change - for that reason, run it second.
+ justReduced = tryToEmptyFunctions(names) || tryToRemoveFunctions(names);
if (justReduced) {
noteReduction(names.size());
i += skip;