From b7ea33b8ac008c0ccd2fbfc4c7bf7286e9c7c7f6 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Tue, 22 Feb 2011 00:05:37 +0100 Subject: [PATCH] Don't inline stloc instructions. --- ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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 {