diff --git a/ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs b/ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs index 357d611e2..1dd745931 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs @@ -202,9 +202,13 @@ namespace ICSharpCode.Decompiler.IL.Transforms bool IsSameTarget(ILInstruction target, ILInstruction left) { IField f, f2; - ILInstruction t, t2; + ILInstruction t, t2, a, a2; + IType type, type2; if (target.MatchLdFlda(out t, out f) && left.MatchLdFlda(out t2, out f2) && f.Equals(f2)) return true; + // match ldelmena(ldobj(...)) + if (target.MatchLdElema(out type, out a) && left.MatchLdElema(out type2, out a2) && type.Equals(type2)) + return a.MatchLdObj(out target, out type) && a2.MatchLdObj(out left, out type2) && IsSameTarget(target, left); return false; }