diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/DeadArgumentElimination.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/passes/DeadArgumentElimination.cpp b/src/passes/DeadArgumentElimination.cpp index 601acfc5c..419ae1aca 100644 --- a/src/passes/DeadArgumentElimination.cpp +++ b/src/passes/DeadArgumentElimination.cpp @@ -682,6 +682,18 @@ private: return false; } } + for (auto* call : FindAll<CallRef>(func->body).list) { + if (call->isReturn) { + auto targetType = call->target->type; + if (targetType == Type::unreachable) { + continue; + } + if (!processReturnType( + targetType.getHeapType().getSignature().results)) { + return false; + } + } + } assert(refinedType != originalType); // If the refined type is unreachable then nothing actually returns from |