Author: martin
Date: 2005-04-18 11:31:34 -0400 (Mon, 18 Apr 2005)
New Revision: 43224
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/driver.cs
trunk/mcs/gmcs/statement.cs
Log:
**** Merged r42420-42429 from MCS ****
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2005-04-18 15:31:11 UTC (rev 43223)
+++ trunk/mcs/gmcs/ChangeLog 2005-04-18 15:31:34 UTC (rev 43224)
@@ -1,3 +1,12 @@
+2005-03-31 Raja R Harinath <[EMAIL PROTECTED]>
+
+ Fix difference in behaviour with commandline invocation.
+ * driver.cs (Driver.Reset): New.
+ (CompilerCallableEntryPoint): Call it.
+
+ * statement.cs (If.Resolve): Avoid spurious "uninitialized
+ variable" warnings if the boolean expression failed to resolve.
+
2005-03-30 Sebastien Pouliot <[EMAIL PROTECTED]>
* attribute.cs: Fix the union of several permissions when some of them
Modified: trunk/mcs/gmcs/driver.cs
===================================================================
--- trunk/mcs/gmcs/driver.cs 2005-04-18 15:31:11 UTC (rev 43223)
+++ trunk/mcs/gmcs/driver.cs 2005-04-18 15:31:34 UTC (rev 43224)
@@ -101,6 +101,23 @@
//
static bool using_default_encoder = true;
+
+ static public void Reset ()
+ {
+ want_debugging_support = false;
+ parse_only = false;
+ timestamps = false;
+ pause = false;
+ show_counters = false;
+ load_default_config = true;
+ resources = embedded_resources = null;
+ win32ResourceFile = win32IconFile = null;
+ defines = null;
+ output_file = null;
+ encoding = null;
+ using_default_encoder = true;
+ }
+
public static void ShowTime (string msg)
{
if (!timestamps)
@@ -1760,6 +1777,7 @@
static void Reset ()
{
+ Driver.Reset ();
Location.Reset ();
RootContext.Reset ();
Report.Reset ();
Modified: trunk/mcs/gmcs/statement.cs
===================================================================
--- trunk/mcs/gmcs/statement.cs 2005-04-18 15:31:11 UTC (rev 43223)
+++ trunk/mcs/gmcs/statement.cs 2005-04-18 15:31:34 UTC (rev 43224)
@@ -139,11 +139,14 @@
public override bool Resolve (EmitContext ec)
{
+ bool ok = true;
+
Report.Debug (1, "START IF BLOCK", loc);
expr = Expression.ResolveBoolean (ec, expr, loc);
if (expr == null){
- return false;
+ ok = false;
+ goto skip;
}
Assign ass = expr as Assign;
@@ -177,17 +180,17 @@
return true;
}
-
+ skip:
ec.StartFlowBranching
(FlowBranching.BranchingType.Conditional, loc);
- bool ok = TrueStatement.Resolve (ec);
+ ok &= TrueStatement.Resolve (ec);
is_true_ret =
ec.CurrentBranching.CurrentUsageVector.Reachability.IsUnreachable;
ec.CurrentBranching.CreateSibling ();
- if ((FalseStatement != null) && !FalseStatement.Resolve
(ec))
- ok = false;
+ if (FalseStatement != null)
+ ok &= FalseStatement.Resolve (ec);
ec.EndFlowBranching ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches