Browse Source

Fix #2530: ArgumentOutOfRangeException in PatternMatchRefTypes

pull/2542/head
Siegfried Pammer 4 years ago
parent
commit
22c98016a9
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/PatternMatchingTransform.cs

2
ICSharpCode.Decompiler/IL/Transforms/PatternMatchingTransform.cs

@ -132,7 +132,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -132,7 +132,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
{
// stloc v(ldloc s)
pos--;
if (!block.Instructions[pos].MatchStLoc(s, out value))
if (pos < 0 || !block.Instructions[pos].MatchStLoc(s, out value))
return false;
if (v.Kind is not (VariableKind.Local or VariableKind.StackSlot))
return false;

Loading…
Cancel
Save