diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/RemoveUnusedFunctions.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/passes/RemoveUnusedFunctions.cpp b/src/passes/RemoveUnusedFunctions.cpp index 78b0f0ffc..ec9e271b7 100644 --- a/src/passes/RemoveUnusedFunctions.cpp +++ b/src/passes/RemoveUnusedFunctions.cpp @@ -36,7 +36,9 @@ struct RemoveUnusedFunctions : public Pass { } // Exports are roots. for (auto& curr : module->exports) { - root.push_back(module->getFunction(curr->value)); + if (curr->kind == ExternalKind::Function) { + root.push_back(module->getFunction(curr->value)); + } } // For now, all functions that can be called indirectly are marked as roots. for (auto& segment : module->table.segments) { |