Browse Source

Make simple array initializer detection a little bit more flexible.

pull/728/merge
Siegfried Pammer 9 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 @@ -197,9 +197,10 @@ namespace ICSharpCode.Decompiler.IL.Transforms
ILInstruction array;
if (pos + elementCount >= block.Instructions.Count)
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++;
return array.MatchLdLoc(store);
} else {
finalStore = store;
}
return true;
}

Loading…
Cancel
Save