+ protected void EmitConditionalAccess (EmitContext ec)
+ {
+ var a_expr = arguments [0].Expr;
+
+ var des = a_expr as DynamicExpressionStatement;
+ if (des != null) {
+ des.EmitConditionalAccess (ec);
+ }
+
+ if (HasConditionalAccess ()) {
+ var NullOperatorLabel = ec.DefineLabel ();
+
+ if (ExpressionAnalyzer.IsInexpensiveLoad (a_expr)) {
+ a_expr.Emit (ec);
+ } else {
+ var lt = new LocalTemporary (a_expr.Type);
+ lt.EmitAssign (ec, a_expr, true, false);
+
+ Arguments [0].Expr = lt;
+ }
+
+ ec.Emit (OpCodes.Brtrue_S, NullOperatorLabel);
+
+ if (!ec.ConditionalAccess.Statement) {
+ if (ec.ConditionalAccess.Type.IsNullableType)
+ Nullable.LiftedNull.Create (ec.ConditionalAccess.Type, Location.Null).Emit (ec);
+ else
+ ec.EmitNull ();
+ }
+
+ ec.Emit (OpCodes.Br, ec.ConditionalAccess.EndLabel);
+ ec.MarkLabel (NullOperatorLabel);
+
+ return;
+ }
+
+ if (a_expr.HasConditionalAccess ()) {
+ var lt = new LocalTemporary (a_expr.Type);
+ lt.EmitAssign (ec, a_expr, false, false);
+
+ Arguments [0].Expr = lt;
+ }
+ }
+