Browse Source

Fix #1571: Expression transforms not running for values of inline assignments.

pull/1596/head
Daniel Grunwald 6 years ago
parent
commit
3314f3f37a
  1. 11
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/InlineAssignmentTest.cs
  2. 9
      ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs

11
ICSharpCode.Decompiler.Tests/TestCases/Pretty/InlineAssignmentTest.cs

@ -32,11 +32,17 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -32,11 +32,17 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
get;
set;
}
public static int StaticProperty {
get;
set;
}
public bool BoolProperty {
get;
set;
}
public void SimpleInlineWithLocals()
{
int index;
@ -136,5 +142,10 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -136,5 +142,10 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{
return InstanceProperty = GetIndex();
}
public bool BoolPropertyTest(object x)
{
return BoolProperty = (x != null);
}
}
}

9
ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs

@ -64,8 +64,13 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -64,8 +64,13 @@ namespace ICSharpCode.Decompiler.IL.Transforms
protected internal override void VisitBlock(Block block)
{
// Don't visit child blocks; since this is a block transform
// we know those were already handled previously.
if (block.Kind == BlockKind.ControlFlow) {
// Don't visit child control flow blocks;
// since this is a block transform
// we know those were already handled previously.
return;
}
base.VisitBlock(block);
}
protected internal override void VisitComp(Comp inst)

Loading…
Cancel
Save