Browse Source

Fix unit test failure

pull/734/head
Siegfried Pammer 10 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
var affectedUsages = nextInstruction.Descendants var affectedUsages = nextInstruction.Descendants
.OfType<IInstructionWithVariableOperand>().Where(ins => ins.Variable == inst.Variable) .OfType<IInstructionWithVariableOperand>().Where(ins => ins.Variable == inst.Variable)
.Cast<ILInstruction>().ToArray(); .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; return false;
foreach (var usage in affectedUsages) { foreach (var usage in affectedUsages) {
usage.ReplaceWith(valueToCopy.Clone()); usage.ReplaceWith(valueToCopy.Clone());

Loading…
Cancel
Save