Browse Source

Fixed decompiling empty async methods.

Fixes #417 #446 #479
pull/487/head
LordJZ 11 years ago
parent
commit
a997ea2068
  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
case ILCode.Br: case ILCode.Br:
case ILCode.Leave: case ILCode.Leave:
ranges[(ILLabel)expr.Operand].UnionWith(nodeRange); ranges[(ILLabel)expr.Operand].UnionWith(nodeRange);
if (i == bodyLength - 1)
// no states
goto default;
break; break;
case ILCode.Brtrue: case ILCode.Brtrue:
{ {

4
ICSharpCode.Decompiler/Tests/Async.cs

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

Loading…
Cancel
Save