Browse Source

Fix for the first instruction not inlineing

pull/1/head^2
David Srbecký 15 years ago
parent
commit
f321e6469a
  1. 4
      ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs

4
ICSharpCode.Decompiler/ILAst/ILAstBuilder.cs

@ -265,6 +265,8 @@ namespace Decompiler @@ -265,6 +265,8 @@ namespace Decompiler
// Try to in-line stloc / ldloc pairs
for(int i = 0; i < ast.Count - 1; i++) {
if (i < 0) continue;
ILExpression expr = ast[i] as ILExpression;
ILExpression nextExpr = ast[i + 1] as ILExpression;
@ -290,7 +292,7 @@ namespace Decompiler @@ -290,7 +292,7 @@ namespace Decompiler
ast.RemoveAt(i);
}
nextExpr.Arguments[j] = expr.Arguments[0]; // Inline the stloc body
i = Math.Max(0, i - 2); // Try the same index again
i -= 2; // Try the same index again
break; // Found
}
} else {

Loading…
Cancel
Save