|
|
|
@ -205,6 +205,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms
@@ -205,6 +205,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms
|
|
|
|
|
if (!CheckContainerLengthVariableUseCount(containerLengthVar, startIndexKind)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (!call.IsDescendantOf(block.Instructions[pos])) |
|
|
|
|
return; |
|
|
|
|
// startOffsetVar might be used deep inside a complex statement, ensure we can inline up to that point:
|
|
|
|
|
for (int i = startPos; i < pos; i++) { |
|
|
|
|
if (!ILInlining.CanInlineInto(block.Instructions[pos], startOffsetVar, block.Instructions[i])) |
|
|
|
@ -275,6 +277,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms
@@ -275,6 +277,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms
|
|
|
|
|
} |
|
|
|
|
if (!(sliceLengthVar.LoadInstructions.Single().Parent is CallInstruction call)) |
|
|
|
|
return; |
|
|
|
|
if (!call.IsDescendantOf(block.Instructions[pos])) |
|
|
|
|
return; |
|
|
|
|
if (!IsSlicingMethod(call.Method)) |
|
|
|
|
return; |
|
|
|
|
if (call.Arguments.Count != 3) |
|
|
|
|