Browse Source

Fix bug in TransformArrayInitializers.HandleJaggedArrayInitializer

pull/925/merge
Siegfried Pammer 8 years ago
parent
commit
a9fd937099
  1. 6
      ICSharpCode.Decompiler/IL/Transforms/TransformArrayInitializers.cs

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

@ -213,8 +213,12 @@ namespace ICSharpCode.Decompiler.IL.Transforms
instructionsToRemove += inc; instructionsToRemove += inc;
} }
ILInstruction array; ILInstruction array;
if (block.Instructions[pos].MatchStLoc(out finalStore, out array)) // In case there is an extra copy of the store variable
// Remove it and use its value instead.
if (block.Instructions[pos].MatchStLoc(out finalStore, out array)) {
instructionsToRemove++;
return array.MatchLdLoc(store); return array.MatchLdLoc(store);
}
finalStore = store; finalStore = store;
return true; return true;
} }

Loading…
Cancel
Save