Browse Source

Fix unit test failure

pull/734/head
Siegfried Pammer 9 years ago
parent
commit
e921239bda
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/TransformInlineAssignment.cs

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

@ -131,7 +131,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -131,7 +131,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
var affectedUsages = nextInstruction.Descendants
.OfType<IInstructionWithVariableOperand>().Where(ins => ins.Variable == inst.Variable)
.Cast<ILInstruction>().ToArray();
if (affectedUsages.Any(ins => !(ins.Parent is StObj || ins.Parent is LdObj)))
if (affectedUsages.Length == 0 || affectedUsages.Any(ins => !(ins.Parent is StObj || ins.Parent is LdObj)))
return false;
foreach (var usage in affectedUsages) {
usage.ReplaceWith(valueToCopy.Clone());

Loading…
Cancel
Save