[jit] Fix the saving of the 'cfg->ret_var_set' flag when inlining, it was set to...
[mono.git] / mcs / mcs / assign.cs
index 04cfe49f1f867158e76a486138ba87982f9a1762..a07c8c0ef397d1e2d597680f035cf078aa732489 100644 (file)
@@ -390,6 +390,7 @@ namespace Mono.CSharp {
 
                        return System.Linq.Expressions.Expression.Assign (target_object, source_object);
                }
+
                protected virtual Expression ResolveConversions (ResolveContext ec)
                {
                        source = Convert.ImplicitConversionRequired (ec, source, target.Type, source.Location);
@@ -501,13 +502,17 @@ namespace Mono.CSharp {
                                pe.SetBackingFieldAssigned (fc);
                                return;
                        }
+
+                       var td = target as TupleDeconstruct;
+                       if (td != null) {
+                               td.SetGeneratedFieldAssigned (fc);
+                               return;
+                       }
                }
 
-               public override void MarkReachable (Reachability rc)
+               public override Reachability MarkReachable (Reachability rc)
                {
-                       var es = source as ExpressionStatement;
-                       if (es != null)
-                               es.MarkReachable (rc);
+                       return source.MarkReachable (rc);
                }
        }
 
@@ -719,9 +724,11 @@ namespace Mono.CSharp {
                                this.loc = child.Location;
                        }
 
+                       public bool RequiresEmitWithAwait { get; set; }
+
                        public override bool ContainsEmitWithAwait ()
                        {
-                               return child.ContainsEmitWithAwait ();
+                               return RequiresEmitWithAwait || child.ContainsEmitWithAwait ();
                        }
 
                        public override Expression CreateExpressionTree (ResolveContext ec)