Don't crash when resolving invalid constant expressions
[mono.git] / mcs / mcs / statement.cs
index f6d4b7f5951b53b69bd46406e5dd70d98af8f4a2..3710cf7977ad1ac14c6d9412c78b9915b2b56f97 100644 (file)
@@ -1945,8 +1945,10 @@ namespace Mono.CSharp {
 
                                ec.CurrentBlock = this;
                                Expression e;
-                               using (ec.With (ResolveContext.Options.ConstantCheckState, (flags & Flags.Unchecked) == 0)) {
-                                       e = cv.Resolve (ec);
+                               using (ec.With (ResolveContext.Options.ConstantCheckState, (flags & Flags.Unchecked) == 0)) {\r
+                                       using (ec.With (ResolveContext.Options.DoFlowAnalysis, false)) {\r
+                                               e = cv.Resolve (ec);\r
+                                       }
                                }
                                if (e == null)
                                        continue;