Fix #77035.
[mono.git] / mcs / mcs / flowanalysis.cs
index 26f55488cb3a1ec926d5017b32ffd2636746e650..300672d6be0cfdcc4c6e2a4ce2774ca8fa1b59bc 100644 (file)
@@ -776,7 +776,7 @@ namespace Mono.CSharp
                                                if (parameters != null)
                                                        parameters.And (vector.parameters);
                                        }
-                                               
+
                                        Reachability.And (ref reachability, vector.Reachability, true);
 
                                        Report.Debug (1, "  MERGING JUMP ORIGIN #1", vector);
@@ -1895,7 +1895,9 @@ namespace Mono.CSharp
 
                public bool IsAssigned (EmitContext ec)
                {
-                       return !ec.DoFlowAnalysis || ec.CurrentBranching.IsAssigned (this);
+                       return !ec.DoFlowAnalysis ||
+                               ec.OmitStructFlowAnalysis && TypeInfo.IsStruct ||
+                               ec.CurrentBranching.IsAssigned (this);
                }
 
                public bool IsAssigned (EmitContext ec, Location loc)
@@ -1955,7 +1957,9 @@ namespace Mono.CSharp
 
                public bool IsFieldAssigned (EmitContext ec, string name, Location loc)
                {
-                       if (!ec.DoFlowAnalysis || ec.CurrentBranching.IsFieldAssigned (this, name))
+                       if (!ec.DoFlowAnalysis ||
+                               ec.OmitStructFlowAnalysis && TypeInfo.IsStruct ||
+                               ec.CurrentBranching.IsFieldAssigned (this, name))
                                return true;
 
                        Report.Error (170, loc,
@@ -2025,7 +2029,7 @@ namespace Mono.CSharp
 
                VariableInfo[] map;
 
-               public VariableMap (InternalParameters ip)
+               public VariableMap (Parameters ip)
                {
                        Count = ip != null ? ip.Count : 0;
                        
@@ -2038,16 +2042,16 @@ namespace Mono.CSharp
                        for (int i = 0; i < Count; i++) {
                                Parameter.Modifier mod = ip.ParameterModifier (i);
 
-                               if ((mod & Parameter.Modifier.OUT) == 0)
+                               if ((mod & Parameter.Modifier.OUT) != Parameter.Modifier.OUT)
                                        continue;
-                               
+
                                // Dont allocate till we find an out var.
                                if (map == null)
                                        map = new VariableInfo [Count];
 
                                map [i] = new VariableInfo (ip.ParameterName (i),
                                        TypeManager.GetElementType (ip.ParameterType (i)), i, Length);
-                               
+
                                Length += map [i].Length;
                        }
                }