dillon1000/react
Commit
Browse files Value block reassignment uses StoreLocal
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.
Changed paths4 files
First-parent comparisoncompiler/forget/src/CompilerPipeline.ts ModifiedM compiler/forget/src/HIR/BuildHIR.ts ModifiedM compiler/forget/src/HIR/ValidateConsistentIdentifiers.ts ModifiedM compiler/forget/src/ReactiveScopes/BuildReactiveFunction.ts ModifiedPatch
Files changed
Rendering syntax-highlighted changes…