|
|
@ -1326,14 +1326,11 @@ namespace ICSharpCode.Decompiler.CSharp |
|
|
|
TranslatedExpression HandleCompoundAssignment(NumericCompoundAssign inst, AssignmentOperatorType op) |
|
|
|
TranslatedExpression HandleCompoundAssignment(NumericCompoundAssign inst, AssignmentOperatorType op) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var target = Translate(inst.Target); |
|
|
|
var target = Translate(inst.Target); |
|
|
|
var value = Translate(inst.Value); |
|
|
|
|
|
|
|
value = PrepareArithmeticArgument(value, inst.RightInputType, inst.Sign, inst.IsLifted); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TranslatedExpression resultExpr; |
|
|
|
TranslatedExpression resultExpr; |
|
|
|
if (inst.CompoundAssignmentType == CompoundAssignmentType.EvaluatesToOldValue) { |
|
|
|
if (inst.CompoundAssignmentType == CompoundAssignmentType.EvaluatesToOldValue) { |
|
|
|
Debug.Assert(op == AssignmentOperatorType.Add || op == AssignmentOperatorType.Subtract); |
|
|
|
Debug.Assert(op == AssignmentOperatorType.Add || op == AssignmentOperatorType.Subtract); |
|
|
|
Debug.Assert(value.ResolveResult.IsCompileTimeConstant && 1.Equals(value.ResolveResult.ConstantValue)); |
|
|
|
Debug.Assert(inst.Value.MatchLdcI(1)); |
|
|
|
UnaryOperatorType unary; |
|
|
|
UnaryOperatorType unary; |
|
|
|
ExpressionType exprType; |
|
|
|
ExpressionType exprType; |
|
|
|
if (op == AssignmentOperatorType.Add) { |
|
|
|
if (op == AssignmentOperatorType.Add) { |
|
|
@ -1347,6 +1344,8 @@ namespace ICSharpCode.Decompiler.CSharp |
|
|
|
.WithILInstruction(inst) |
|
|
|
.WithILInstruction(inst) |
|
|
|
.WithRR(new OperatorResolveResult(target.Type, exprType, target.ResolveResult)); |
|
|
|
.WithRR(new OperatorResolveResult(target.Type, exprType, target.ResolveResult)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
var value = Translate(inst.Value); |
|
|
|
|
|
|
|
value = PrepareArithmeticArgument(value, inst.RightInputType, inst.Sign, inst.IsLifted); |
|
|
|
switch (op) { |
|
|
|
switch (op) { |
|
|
|
case AssignmentOperatorType.Add: |
|
|
|
case AssignmentOperatorType.Add: |
|
|
|
case AssignmentOperatorType.Subtract: |
|
|
|
case AssignmentOperatorType.Subtract: |
|
|
|