提交 cd2d41b3 编写于 作者: V vsadov

CR feedback

上级 6e1a244c
......@@ -488,7 +488,7 @@ private BoundStatement UpdateStatement(BoundSpillSequenceBuilder builder, BoundS
var result = ArrayBuilder<BoundExpression>.GetInstance();
for (int i = 0; i <= lastSpill; i++)
{
var refKind = refKinds.IsDefaultOrEmpty? RefKind.None: refKinds[i];
var refKind = refKinds.IsDefaultOrEmpty ? RefKind.None : refKinds[i];
var replacement = Spill(builder, newList[i], refKind, sideEffectsOnly);
Debug.Assert(sideEffectsOnly || replacement != null);
......@@ -703,7 +703,7 @@ public override BoundNode VisitAssignmentOperator(BoundAssignmentOperator node)
case BoundKind.FieldAccess:
var field = (BoundFieldAccess)left;
// static fields are directly assignable, LHS is not on th estack, nothing to spill
// static fields are directly assignable, LHS is not on the stack, nothing to spill
if (field.FieldSymbol.IsStatic) break;
// instance fields are directly assignable, but receiver is pushed, so need to spill that.
......@@ -722,7 +722,15 @@ public override BoundNode VisitAssignmentOperator(BoundAssignmentOperator node)
break;
default:
// must be indirectly assignable, just visit and spill
// must be something indirectly assignable, just visit and spill as an ordinary Ref (not a RefReadOnly!!)
//
// NOTE: in some cases this will result in spiller producing an error.
// For example if the LHS is a ref-returning method like
//
// obj.RefReturning(a, b, c) = await Something();
//
// the spiller would eventually have to spill the evaluation result of "refReturning" call as an ordinary Ref,
// which it can't.
left = Spill(leftBuilder, VisitExpression(ref leftBuilder, left), RefKind.Ref);
break;
}
......
......@@ -793,7 +793,7 @@ public static async Task Test()
local = new S1();
// prints 1 42 3 3 note no aliasing for the first two arguments because of spilling of calls
// prints 1 42 3 3 note no aliasing for the first argument because of spilling of calls
M1(GetLocal(ref local).f, await GetT(42), GetLocal(ref local).f, GetLocal(ref local).f);
}
......@@ -861,7 +861,7 @@ public static async Task Test()
local = new S1();
// prints 1 42 3 3 note no aliasing for the first two arguments because of spilling of calls
// prints 1 42 3 3 note no aliasing for the first argument because of spilling of calls
M1(GetLocalWriteable(ref local).f, await GetT(42), GetLocalWriteable(ref local).f, GetLocalWriteable(ref local).f);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册