From 8408cab1fdf67ce9ff331a131f06610909b78e61 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 19 Oct 2020 14:54:38 -0700 Subject: wasm-reduce: When trying to remove a function, try to replace ref.func usages too (#3254) --- src/tools/wasm-reduce.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/tools/wasm-reduce.cpp') diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp index bb2de0896..6b4483dd2 100644 --- a/src/tools/wasm-reduce.cpp +++ b/src/tools/wasm-reduce.cpp @@ -937,6 +937,11 @@ struct Reducer replaceCurrent(Builder(*getModule()).replaceWithIdenticalType(curr)); } } + void visitRefFunc(RefFunc* curr) { + if (names.count(curr->func)) { + replaceCurrent(Builder(*getModule()).replaceWithIdenticalType(curr)); + } + } void visitExport(Export* curr) { if (names.count(curr->value)) { exportsToRemove.push_back(curr->name); -- cgit v1.2.3