Skip to content

Commit 3a7bef8

Browse files
committed
fin
1 parent fd3f58a commit 3a7bef8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/passes/OptimizeInstructions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,8 +1801,8 @@ struct OptimizeInstructions
18011801

18021802
void visitRefEq(RefEq* curr) {
18031803
// Check for unreachability. Note we must check both the children and the
1804-
// ref.eq itself, as in e.g. visitTernary, as we only refinalize at the end,
1805-
// so unreachable children may not update the parent yet.
1804+
// ref.eq itself, as in e.g. optimizeTernary, as we only refinalize at the
1805+
// end, so unreachable children may not update the parent yet.
18061806
auto leftType = curr->left->type;
18071807
auto rightType = curr->right->type;
18081808
if (leftType == Type::unreachable || rightType == Type::unreachable ||

test/lit/passes/optimize-instructions-gc.wast

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3719,7 +3719,8 @@
37193719
;; arm is i31, the other a struct, both non-nullable, and hence there is no
37203720
;; overlap). If we do that, and emit a 0, we'd be turning an unreachable
37213721
;; into a concrete type, and nothing pops that type off the stack, so we
3722-
;; would fail to validate.
3722+
;; would fail to validate. Instead, we should leave this code for DCE, aside
3723+
;; from moving the ref.i31 out.
37233724
(ref.eq
37243725
(if (result (ref i31))
37253726
(unreachable)

0 commit comments

Comments
 (0)