Browse Source

Fix #3190: NRE in YieldReturnDecompiler

pull/3443/head
Siegfried Pammer 4 months ago
parent
commit
51522c4487
  1. 2
      ICSharpCode.Decompiler/IL/ControlFlow/YieldReturnDecompiler.cs

2
ICSharpCode.Decompiler/IL/ControlFlow/YieldReturnDecompiler.cs

@ -1014,7 +1014,7 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
} }
// We can't use MatchStLoc like above since the doFinallyBodies variable is split by SplitVariables. // We can't use MatchStLoc like above since the doFinallyBodies variable is split by SplitVariables.
// This occurs for the Legacy VBC compiler. // This occurs for the Legacy VBC compiler.
if (oldBlock.Instructions[pos].MatchStLoc(out var var, out value) && var.Kind == VariableKind.Local && var.Index == doFinallyBodies.Index) if (oldBlock.Instructions[pos].MatchStLoc(out var var, out value) && var.Kind == VariableKind.Local && var.Index == doFinallyBodies?.Index)
{ {
if (!value.MatchLdcI4(0)) if (!value.MatchLdcI4(0))
{ {

Loading…
Cancel
Save