|
|
|
@ -500,7 +500,17 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -500,7 +500,17 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
inst.Variable.Type = type; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return Assignment(ConvertVariable(inst.Variable).WithoutILInstruction(), translatedValue).WithILInstruction(inst); |
|
|
|
|
var lhs = ConvertVariable(inst.Variable).WithoutILInstruction(); |
|
|
|
|
if (lhs.Expression is DirectionExpression dirExpr && lhs.ResolveResult is ByReferenceResolveResult lhsRefRR) { |
|
|
|
|
// ref (re-)assignment, emit "ref (a = ref b)".
|
|
|
|
|
lhs = lhs.UnwrapChild(dirExpr.Expression); |
|
|
|
|
var assign = new AssignmentExpression(lhs.Expression, translatedValue.Expression) |
|
|
|
|
.WithRR(new OperatorResolveResult(lhs.Type, ExpressionType.Assign, lhsRefRR, translatedValue.ResolveResult)); |
|
|
|
|
return new DirectionExpression(FieldDirection.Ref, assign) |
|
|
|
|
.WithoutILInstruction().WithRR(lhsRefRR); |
|
|
|
|
} else { |
|
|
|
|
return Assignment(lhs, translatedValue).WithILInstruction(inst); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool IsOtherValueType(IType type) |
|
|
|
|
{ |
|
|
|
|