}
private void emitMemberAssignment(final BinaryExpression node, final int flags) {
final MemberExpression lValue = (MemberExpression) node.getLeft();
final Expression rValue = node.getRight();
final MemberInfo member = lValue.getMember();
// emit "this", if any
if (lValue.getTarget() != null) {
emitExpression(lValue.getTarget());
}
// emit value
emitExpression(rValue);
if (!TypeUtils.hasReferenceConversion(rValue.getType(), lValue.getType())) {
generator.emitConversion(rValue.getType(), lValue.getType());
}
LocalBuilder temp = null;
final int emitAs = flags & CompilationFlags.EmitAsTypeMask;
if (emitAs != CompilationFlags.EmitAsVoidType) {
// Save the value so we can return it.
generator.dup();
generator.emitStore(temp = getLocal(node.getType()));
}
switch (member.getMemberType()) {
case Field:
generator.putField((FieldInfo) member);
break;
default:
throw Error.invalidMemberType(member.getMemberType());
}
if (emitAs != CompilationFlags.EmitAsVoidType) {
generator.emitLoad(temp);
freeLocal(temp);