Browse Source

Merge pull request #487 from LordJZ/case/empty-async-method

Fixed decompiling empty async methods.
pull/550/head
Siegfried Pammer 10 years ago
parent
commit
b9165c6704
  1. 3
      ICSharpCode.Decompiler/ILAst/StateRange.cs
  2. 4
      ICSharpCode.Decompiler/Tests/Async.cs

3
ICSharpCode.Decompiler/ILAst/StateRange.cs

@ -212,6 +212,9 @@ namespace ICSharpCode.Decompiler.ILAst @@ -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:
{

4
ICSharpCode.Decompiler/Tests/Async.cs

@ -25,6 +25,10 @@ using System.Threading.Tasks; @@ -25,6 +25,10 @@ using System.Threading.Tasks;
public class Async
{
public async void EmptyAsyncMethod()
{
}
public async void SimpleVoidMethod()
{
Console.WriteLine("Before");

Loading…
Cancel
Save