Browse Source

Fix #1327: BlockBuilder: ILRange was not set on last block of outer containers, if there were nested containers, such as try/finally.

pull/1347/head
Siegfried Pammer 7 years ago
parent
commit
5b7e1b844f
  1. 7
      ICSharpCode.Decompiler/IL/BlockBuilder.cs

7
ICSharpCode.Decompiler/IL/BlockBuilder.cs

@ -166,7 +166,12 @@ namespace ICSharpCode.Decompiler.IL @@ -166,7 +166,12 @@ namespace ICSharpCode.Decompiler.IL
FinalizeCurrentBlock(inst.ILRange.End, fallthrough: true);
}
FinalizeCurrentBlock(mainContainer.ILRange.End, fallthrough: false);
containerStack.Clear();
// Finish up all containers
while (containerStack.Count > 0) {
currentContainer = containerStack.Pop();
currentBlock = currentContainer.Blocks.Last();
FinalizeCurrentBlock(mainContainer.ILRange.End, fallthrough: false);
}
ConnectBranches(mainContainer, cancellationToken);
}

Loading…
Cancel
Save