Browse Source

TransformCollectionAndObjectInitializers: only add step right before transforming.

pull/863/head
Siegfried Pammer 8 years ago
parent
commit
000f94caad
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/TransformCollectionAndObjectInitializers.cs

2
ICSharpCode.Decompiler/IL/Transforms/TransformCollectionAndObjectInitializers.cs

@ -80,7 +80,6 @@ namespace ICSharpCode.Decompiler.IL.Transforms
default: default:
return false; return false;
} }
context.Step("CollectionOrObjectInitializer", inst);
int initializerItemsCount = 0; int initializerItemsCount = 0;
var blockType = initializerBlock?.Type ?? BlockType.CollectionInitializer; var blockType = initializerBlock?.Type ?? BlockType.CollectionInitializer;
var possibleIndexVariables = new Dictionary<ILVariable, (int Index, ILInstruction Value)>(); var possibleIndexVariables = new Dictionary<ILVariable, (int Index, ILInstruction Value)>();
@ -98,6 +97,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
} }
if (initializerItemsCount <= 0) if (initializerItemsCount <= 0)
return false; return false;
context.Step("CollectionOrObjectInitializer", inst);
ILVariable finalSlot; ILVariable finalSlot;
if (initializerBlock == null) { if (initializerBlock == null) {
initializerBlock = new Block(blockType); initializerBlock = new Block(blockType);

Loading…
Cancel
Save