Browse Source

Fix #1101: Error decompiling System.Threading.Tasks.Task System.Net.WebSockets.ClientWebSocket::ConnectAsyncCore(System.Uri,System.Threading.CancellationToken)

pull/1108/head
Siegfried Pammer 7 years ago
parent
commit
b9a6df374d
  1. 4
      ICSharpCode.Decompiler/IL/ControlFlow/AwaitInCatchTransform.cs

4
ICSharpCode.Decompiler/IL/ControlFlow/AwaitInCatchTransform.cs

@ -139,8 +139,8 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -139,8 +139,8 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
return false;
if (!catchBlock.Instructions.Last().MatchBranch(out var jumpTableStartBlock))
return false;
if (catchBlock.Instructions.Count > 2) {
objectVariableStore = (StLoc)catchBlock.Instructions[catchBlock.Instructions.Count - 3];
if (catchBlock.Instructions.Count > 2 && catchBlock.Instructions[catchBlock.Instructions.Count - 3] is StLoc stloc) {
objectVariableStore = stloc;
}
var identifierVariableAssignment = catchBlock.Instructions.SecondToLastOrDefault();
if (!identifierVariableAssignment.MatchStLoc(out identifierVariable, out var value) || !value.MatchLdcI4(out id))

Loading…
Cancel
Save