Browse Source

Limit the number of instructions validated for the $"{transform.GetType().Name} modified an instruction before pos" assertion; this makes debug-mode performance less horrible.

pull/1464/head
Daniel Grunwald 7 years ago
parent
commit
4987f78d21
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/StatementTransform.cs

2
ICSharpCode.Decompiler/IL/Transforms/StatementTransform.cs

@ -125,7 +125,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
transform.Run(block, pos, ctx);
#if DEBUG
block.Instructions[pos].CheckInvariant(ILPhase.Normal);
for (int i = 0; i < pos; ++i) {
for (int i = Math.Max(0, pos - 100); i < pos; ++i) {
if (block.Instructions[i].IsDirty) {
Debug.Fail($"{transform.GetType().Name} modified an instruction before pos");
}

Loading…
Cancel
Save