Browse Source

Don't inline stloc instructions.

pull/37/head
Daniel Grunwald 15 years ago
parent
commit
b7ea33b8ac
  1. 13
      ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs

13
ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs

@ -495,20 +495,15 @@ namespace Decompiler @@ -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 {

Loading…
Cancel
Save