Browse Source

Fix #1379: Missing ILRange from yield return FSM.

pull/1397/head
Siegfried Pammer 6 years ago
parent
commit
17d19cd04a
  1. 2
      ICSharpCode.Decompiler/IL/ControlFlow/YieldReturnDecompiler.cs

2
ICSharpCode.Decompiler/IL/ControlFlow/YieldReturnDecompiler.cs

@ -649,7 +649,7 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
private BlockContainer ConvertBody(BlockContainer oldBody, StateRangeAnalysis rangeAnalysis) private BlockContainer ConvertBody(BlockContainer oldBody, StateRangeAnalysis rangeAnalysis)
{ {
var blockStateMap = rangeAnalysis.GetBlockStateSetMapping(oldBody); var blockStateMap = rangeAnalysis.GetBlockStateSetMapping(oldBody);
BlockContainer newBody = new BlockContainer(); BlockContainer newBody = new BlockContainer() { ILRange = oldBody.ILRange };
// create all new blocks so that they can be referenced by gotos // create all new blocks so that they can be referenced by gotos
for (int blockIndex = 0; blockIndex < oldBody.Blocks.Count; blockIndex++) { for (int blockIndex = 0; blockIndex < oldBody.Blocks.Count; blockIndex++) {
newBody.Blocks.Add(new Block { ILRange = oldBody.Blocks[blockIndex].ILRange }); newBody.Blocks.Add(new Block { ILRange = oldBody.Blocks[blockIndex].ILRange });

Loading…
Cancel
Save