Browse Source

Fix bug in compound assignment detection.

pull/728/merge
Siegfried Pammer 9 years ago
parent
commit
d92ba2717c
  1. 3
      ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs

3
ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs

@ -204,8 +204,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -204,8 +204,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms
IField f, f2;
ILInstruction t, t2, a, a2;
IType type, type2;
ILVariable v;
if (target.MatchLdFlda(out t, out f) && left.MatchLdFlda(out t2, out f2) && f.Equals(f2))
return true;
return !t.MatchLdLoc(out v) || t2.MatchLdLoc(v);
// 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);

Loading…
Cancel
Save