diff --git a/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs b/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs index 2367bd049..a8f142969 100644 --- a/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs +++ b/ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs @@ -495,20 +495,15 @@ namespace Decompiler bool canInline; allowInline.TryGetValue((ILVariable)arg.Operand, out canInline); - // Assigne the ranges for optimized away instrustions somewhere - currExpr.Arguments[0].ILRanges.AddRange(currExpr.ILRanges); - currExpr.Arguments[0].ILRanges.AddRange(nextExpr.Arguments[j].ILRanges); - if (canInline) { + // Assigne the ranges for optimized away instrustions somewhere + currExpr.Arguments[0].ILRanges.AddRange(currExpr.ILRanges); + currExpr.Arguments[0].ILRanges.AddRange(nextExpr.Arguments[j].ILRanges); + ast.RemoveAt(i); nextExpr.Arguments[j] = currExpr.Arguments[0]; // Inline the stloc body i -= 2; // Try the same index again break; // Found - } else { - ast.RemoveAt(i); - nextExpr.Arguments[j] = currExpr; // Inline the whole stloc - i -= 2; // Try the same index again - break; // Found } } } else {