Skip to content

Commit

Permalink
Fix exception when there is a branch before the start of a try block …
Browse files Browse the repository at this point in the history
…in an iterator
  • Loading branch information
Zhentar committed Nov 29, 2016
1 parent 1a35677 commit 6a1e79c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ICSharpCode.Decompiler/ILAst/YieldReturnDecompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ void ScanLine(YieldVMStat vm, int start, int stop)
if (!vm.addNewNode(node, m))
return;
//add in finally block
if (vm.tryBlockMapping.ContainsKey(m + 1) && vm.tryBlockMapping[m].blk == vm.tryBlockMapping[m + 1].blk &&
if (vm.tryBlockMapping.ContainsKey(m) && vm.tryBlockMapping.ContainsKey(m + 1) && vm.tryBlockMapping[m].blk == vm.tryBlockMapping[m + 1].blk &&
vm.tryBlockMapping[m].nodelistRef != vm.tryBlockMapping[m + 1].nodelistRef)
ScanLine(vm, m + 1, vm.usefulList.Count);
if (lbPos < m)
Expand Down

2 comments on commit 6a1e79c

@DingoDjango
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This release fails to open for me. The exe is listed for a brief few seconds in Task Manager then closes.

@Zhentar
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've rebuilt, repacked, and reuploaded and I think it works now, so you can try again. This fix doesn't affect RimWorld, though.

Please sign in to comment.