summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-07-29 10:34:34 -0700
committerGitHub <noreply@github.com>2021-07-29 10:34:34 -0700
commitbe119e310624aa332fb476613a6e970fe214ec83 (patch)
tree8c75509a03af833b01bf10f5444042a52c409473 /src
parent518ec5e028f540af69c9a346c4232941d81367ac (diff)
downloadbinaryen-be119e310624aa332fb476613a6e970fe214ec83.tar.gz
binaryen-be119e310624aa332fb476613a6e970fe214ec83.tar.bz2
binaryen-be119e310624aa332fb476613a6e970fe214ec83.zip
[Wasm GC] Handle call_ref in DeadArgument return refinement (#4038)
Diffstat (limited to 'src')
-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