mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
As part of removing Instruction.lvalue we need to ensure that it is only used to represent that instruction's value — the InstructionKind should always be Const. The one place where we violated this was for value blocks, specifically ConditionalExpression and LogicalExpression. For both of those, we generate a single temporary place to represent the expression result. Then the consequent and alternate branch ended in a `LoadLocal` that reassigned that temporary (in the lvalue) to the result of that branch. This PR changes to use StoreLocal instead, and updates the recently added validation pass to ensure that all identifiers that appear in an Instruction.lvalue are only ever assigned once.