Browse Source

Extend ILInlining to work with StringToInt instructions inside Switch instruction.

pull/1425/head
Siegfried Pammer 6 years ago
parent
commit
6e49efd5aa
  1. 8
      ICSharpCode.Decompiler/IL/Transforms/ILInlining.cs

8
ICSharpCode.Decompiler/IL/Transforms/ILInlining.cs

@ -389,7 +389,13 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -389,7 +389,13 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return false;
}
case OpCode.SwitchInstruction:
return parent == next || (parent.MatchBinaryNumericInstruction(BinaryNumericOperator.Sub) && parent.Parent == next);
if (parent == next)
return true;
if (parent.MatchBinaryNumericInstruction(BinaryNumericOperator.Sub) && parent.Parent == next)
return true;
if (parent is StringToInt stringToInt && stringToInt.Parent == next)
return true;
return false;
default:
return false;
}

Loading…
Cancel
Save