summaryrefslogtreecommitdiff
path: root/src/passes/DeadArgumentElimination.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/DeadArgumentElimination.cpp')
-rw-r--r--src/passes/DeadArgumentElimination.cpp12
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