From be119e310624aa332fb476613a6e970fe214ec83 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 29 Jul 2021 10:34:34 -0700 Subject: [Wasm GC] Handle call_ref in DeadArgument return refinement (#4038) --- src/passes/DeadArgumentElimination.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') 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(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 -- cgit v1.2.3