Skip to content

Commit

Permalink
Cherry-pick relevant changes from other PR
Browse files Browse the repository at this point in the history
  • Loading branch information
alrz committed Mar 5, 2024
1 parent 9ed6e9d commit fbe5cdf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3043,7 +3043,7 @@ public override BoundNode VisitLoweredIsPatternExpression(BoundLoweredIsPatternE
{
var savedState = this.State.Clone();
VisitStatements(node.Statements);
this.State = savedState;
SetState(savedState);
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,13 @@ internal BoundExpression LowerGeneralIsPattern(BoundIsPatternExpression node, Bo

// lower the decision dag.
ImmutableArray<BoundStatement> loweredDag = LowerDecisionDagCore(decisionDag);
var resultBuilder = ArrayBuilder<BoundStatement>.GetInstance(loweredDag.Length + _statements.Count);
resultBuilder.AddRange(loweredDag);
resultBuilder.AddRange(_statements);
return _factory.Sequence(
_tempAllocator.AllTemps(),
sideEffectsBuilder.ToImmutableAndFree(),
new BoundLoweredIsPatternExpression(
node.Syntax,
// Note: it is not expected for this node to trigger spilling
resultBuilder.ToImmutableAndFree(),
loweredDag.AddRange(_statements),
node.WhenTrueLabel,
node.WhenFalseLabel,
node.Type));
Expand Down

0 comments on commit fbe5cdf

Please sign in to comment.