From c8661e115309626a87708cb25067b6a3210367fe Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 8 Oct 2020 16:00:20 -0700 Subject: Fuzz fix for DuplicateFunctionElimination (#3204) The replaceFunctions utility replaced exports by name, but did not check the kind, so it could get confused when names happen to overlap. --- src/passes/opt-utils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/passes/opt-utils.h b/src/passes/opt-utils.h index 7912a7d92..cc0f40c54 100644 --- a/src/passes/opt-utils.h +++ b/src/passes/opt-utils.h @@ -97,7 +97,9 @@ inline void replaceFunctions(PassRunner* runner, } // replace in exports for (auto& exp : module.exports) { - maybeReplace(exp->value); + if (exp->kind == ExternalKind::Function) { + maybeReplace(exp->value); + } } } -- cgit v1.2.3