From d92ba2717c47f367069dd189eaec7a5bd02f2682 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Mon, 25 Jul 2016 19:39:49 +0900 Subject: [PATCH] Fix bug in compound assignment detection. --- ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs b/ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs index 29149b4cd..4c55f5dc0 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs @@ -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);