Author: marek
Date: 2008-02-19 07:23:31 -0500 (Tue, 19 Feb 2008)
New Revision: 96126
Modified:
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/constant.cs
trunk/mcs/mcs/expression.cs
Log:
2008-02-19 Marek Safar <[EMAIL PROTECTED]>
* constant.cs (SideEffectConstant): Don't emit boolean constant.
* expression.cs: Fold immediately LogicalAnd operators when both sides
are
constants.
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2008-02-19 09:34:02 UTC (rev 96125)
+++ trunk/mcs/mcs/ChangeLog 2008-02-19 12:23:31 UTC (rev 96126)
@@ -1,3 +1,10 @@
+2008-02-19 Marek Safar <[EMAIL PROTECTED]>
+
+ * constant.cs (SideEffectConstant): Don't emit boolean constant.
+
+ * expression.cs: Fold immediately LogicalAnd operators when both sides
are
+ constants.
+
2008-02-18 Marek Safar <[EMAIL PROTECTED]>
A fix for bug #361457
Modified: trunk/mcs/mcs/constant.cs
===================================================================
--- trunk/mcs/mcs/constant.cs 2008-02-19 09:34:02 UTC (rev 96125)
+++ trunk/mcs/mcs/constant.cs 2008-02-19 12:23:31 UTC (rev 96126)
@@ -1784,9 +1784,7 @@
public override void Emit (EmitContext ec)
{
- left.Emit (ec);
right.Emit (ec);
- ec.ig.Emit (OpCodes.Pop);
}
public override bool IsDefaultValue {
Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2008-02-19 09:34:02 UTC (rev 96125)
+++ trunk/mcs/mcs/expression.cs 2008-02-19 12:23:31 UTC (rev 96126)
@@ -2568,10 +2568,9 @@
return new EnumConstant (lc,
rc.Type);
//
- // Optimize cases that have no
side-effects, to avoid
- // emitting code that gets popped
+ // Optimize cases that have no
side-effects
//
- if (right is FieldExpr)
+ if (rc != null)
return lc;
// Side effect code:
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches