From 087cb2489d447e87ff62ecdd91bf42bc8d9d0a22 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 16 Feb 2019 23:37:57 +0100 Subject: [PATCH] Fix #1049: Unimplemented decompiler settings --- .../IL/Transforms/TransformAssignment.cs | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs b/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs index 33a308ca1..9a3d5e877 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs @@ -35,18 +35,21 @@ namespace ICSharpCode.Decompiler.IL.Transforms void IStatementTransform.Run(Block block, int pos, StatementTransformContext context) { this.context = context; - if (TransformInlineAssignmentStObjOrCall(block, pos) || TransformInlineAssignmentLocal(block, pos)) { - // both inline assignments create a top-level stloc which might affect inlining - context.RequestRerun(); - return; + if (context.Settings.MakeAssignmentExpressions) { + if (TransformInlineAssignmentStObjOrCall(block, pos) || TransformInlineAssignmentLocal(block, pos)) { + // both inline assignments create a top-level stloc which might affect inlining + context.RequestRerun(); + return; + } } - if (TransformPostIncDecOperatorWithInlineStore(block, pos) - || TransformPostIncDecOperator(block, pos) - || TransformPostIncDecOperatorLocal(block, pos)) - { - // again, new top-level stloc might need inlining: - context.RequestRerun(); - return; + if (context.Settings.IntroduceIncrementAndDecrement) { + if (TransformPostIncDecOperatorWithInlineStore(block, pos) + || TransformPostIncDecOperator(block, pos) + || TransformPostIncDecOperatorLocal(block, pos)) { + // again, new top-level stloc might need inlining: + context.RequestRerun(); + return; + } } }