Skip to content

Commit b2ca674

Browse files
committed
Use pattern matching
1 parent c0f50a1 commit b2ca674

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ICSharpCode.Decompiler/IL/Transforms/TransformCollectionAndObjectInitializers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ void IStatementTransform.Run(Block block, int pos, StatementTransformContext con
9898
return;
9999
}
100100
// Copy-propagate stack slot holding an 'ldloca' of the variable
101-
if (pos < block.Instructions.Count && block.Instructions[pos + 1] is StLoc { Variable: { Kind: VariableKind.StackSlot, IsSingleDefinition: true }, Value: LdLoca ldLoca } && ldLoca.Variable == v)
101+
if (pos < block.Instructions.Count && block.Instructions[pos + 1] is StLoc { Variable: { Kind: VariableKind.StackSlot, IsSingleDefinition: true }, Value: LdLoca ldLoca } stLocStack && ldLoca.Variable == v)
102102
{
103-
CopyPropagation.Propagate((StLoc)block.Instructions[pos + 1], context);
103+
CopyPropagation.Propagate(stLocStack, context);
104104
}
105105
int initializerItemsCount = 0;
106106
bool initializerContainsInitOnlyItems = false;

0 commit comments

Comments
 (0)