Browse Source

Fix bug in DetectLoop: do not accidentally add IncrementBlock to AdditionalBlocks.

pull/870/merge
Siegfried Pammer 8 years ago
parent
commit
307f782a09
  1. 1
      ICSharpCode.Decompiler/IL/DetectedLoop.cs

1
ICSharpCode.Decompiler/IL/DetectedLoop.cs

@ -110,6 +110,7 @@ namespace ICSharpCode.Decompiler.IL @@ -110,6 +110,7 @@ namespace ICSharpCode.Decompiler.IL
if (IncrementBlock.Instructions[0] is StLoc increment)
IncrementTarget = increment.Variable;
AdditionalBlocks = Container.Blocks.Skip(1).Where(b => b != IncrementBlock).ToArray();
return this;
} else if (trueInst is Block block) {
var variable = GetVariableFromCondition(conditionInst);
var last = block.Instructions.LastOrDefault();

Loading…
Cancel
Save