From c15c15555951c736da66c04a4e0489ad40592d6f Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Wed, 12 Jun 2024 14:49:13 -0700 Subject: [PATCH] Update on "[compiler] Fix merging of queues states in InferReferenceEffects" Fixes a bug found by mofeiZ in #29878. When we merge queued states, if the new state does not introduce changes relative to the queued state we should use the queued state, not the new state. [ghstack-poisoned] --- .../__tests__/fixtures/compiler/phi-reference-effects.expect.md | 2 +- .../src/__tests__/fixtures/compiler/phi-reference-effects.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-reference-effects.expect.md b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-reference-effects.expect.md index caab2cd74df75..bef1d7b8368a3 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-reference-effects.expect.md +++ b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-reference-effects.expect.md @@ -10,7 +10,7 @@ function Foo(cond) { x = []; } else { } - // Here, x = phi(x$null, x$[]) does not receive the correct ValueKind + // Here, x = phi(x$null, x$[]) should receive a ValueKind of Mutable arrayPush(x, 2); return x; diff --git a/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-reference-effects.ts b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-reference-effects.ts index 31337809e3be9..092791d586fa8 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-reference-effects.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/phi-reference-effects.ts @@ -6,7 +6,7 @@ function Foo(cond) { x = []; } else { } - // Here, x = phi(x$null, x$[]) does not receive the correct ValueKind + // Here, x = phi(x$null, x$[]) should receive a ValueKind of Mutable arrayPush(x, 2); return x;