Browse Source

Make simple array initializer detection a little bit more flexible.

pull/728/merge
Siegfried Pammer 10 years ago
parent
commit
ec8fc65767
  1. 5
      ICSharpCode.Decompiler/IL/Transforms/TransformArrayInitializers.cs

5
ICSharpCode.Decompiler/IL/Transforms/TransformArrayInitializers.cs

@ -197,9 +197,10 @@ namespace ICSharpCode.Decompiler.IL.Transforms
ILInstruction array; ILInstruction array;
if (pos + elementCount >= block.Instructions.Count) if (pos + elementCount >= block.Instructions.Count)
return false; return false;
if (block.Instructions[pos + elementCount].MatchStLoc(out finalStore, out array)) { if (block.Instructions[pos + elementCount].MatchStLoc(out finalStore, out array) && array.MatchLdLoc(store)) {
instructionsToRemove++; instructionsToRemove++;
return array.MatchLdLoc(store); } else {
finalStore = store;
} }
return true; return true;
} }

Loading…
Cancel
Save