diff --git a/ICSharpCode.Decompiler/ILAst/StateRange.cs b/ICSharpCode.Decompiler/ILAst/StateRange.cs index 3a3dfc2f3..e41b800cb 100644 --- a/ICSharpCode.Decompiler/ILAst/StateRange.cs +++ b/ICSharpCode.Decompiler/ILAst/StateRange.cs @@ -212,6 +212,9 @@ namespace ICSharpCode.Decompiler.ILAst case ILCode.Br: case ILCode.Leave: ranges[(ILLabel)expr.Operand].UnionWith(nodeRange); + if (i == bodyLength - 1) + // no states + goto default; break; case ILCode.Brtrue: { diff --git a/ICSharpCode.Decompiler/Tests/Async.cs b/ICSharpCode.Decompiler/Tests/Async.cs index 7629dd5e6..b414b21b6 100644 --- a/ICSharpCode.Decompiler/Tests/Async.cs +++ b/ICSharpCode.Decompiler/Tests/Async.cs @@ -25,6 +25,10 @@ using System.Threading.Tasks; public class Async { + public async void EmptyAsyncMethod() + { + } + public async void SimpleVoidMethod() { Console.WriteLine("Before");