Repository navigation
Conversation
ReadTemporaryExpr.isEquivalent ignored its argument and compared this.xref with itself, so a temporary read was reported as equivalent to any expression, including reads of other temporaries and literals such as o.NULL_EXPR. Compare against the other read's xref like the sibling IR expressions do. Claude-Session: https://claude.ai/code/session_01W9Mk18mBNfkPfgg3hYweKq
Member
|
This is already covered in #71245. |
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
PR Type
What is the current behavior?
ReadTemporaryExpr.isEquivalentintemplate/pipeline/ir/src/expression.tsignores its argument:so a temporary read reports itself equivalent to any expression — a read of a different temporary, or an unrelated literal like
o.NULL_EXPR. Every sibling IR expression checks the other operand (e instanceof X && e.xref === this.xref, etc.).I haven't found a template that miscompiles because of this today; it breaks the
isEquivalentcontract that callers such as the trailing-NULL_EXPRtrimming ininstruction.tsrely on.What is the new behavior?
isEquivalentreturns true only for aReadTemporaryExprof the same temporary, matching the sibling expressions.Tests
Added
packages/compiler/test/template/pipeline/expression_spec.tswith three cases (same temporary, different temporary, unrelated expression). Before the fix the last two fail withExpected true to be false; after the fix all three pass.Does this PR introduce a breaking change?
https://claude.ai/code/session_01W9Mk18mBNfkPfgg3hYweKq