Author: marek Date: 2008-02-19 11:56:56 -0500 (Tue, 19 Feb 2008) New Revision: 96164
Modified: trunk/mcs/mcs/ChangeLog trunk/mcs/mcs/cfold.cs trunk/mcs/mcs/constant.cs Log: 2008-02-19 Marek Safar <[EMAIL PROTECTED]> * constant.cs, cfold.cs: SideEffectConstant results can apply for folding. Modified: trunk/mcs/mcs/ChangeLog =================================================================== --- trunk/mcs/mcs/ChangeLog 2008-02-19 16:50:50 UTC (rev 96163) +++ trunk/mcs/mcs/ChangeLog 2008-02-19 16:56:56 UTC (rev 96164) @@ -1,5 +1,9 @@ 2008-02-19 Marek Safar <[EMAIL PROTECTED]> + * constant.cs, cfold.cs: SideEffectConstant results can apply for folding. + +2008-02-19 Marek Safar <[EMAIL PROTECTED]> + A fix for bug #328136 * expression.cs: Do not fold immediately LogicalAnd operators when the left side is a false constant, because we still need to evaluate the right-hand Modified: trunk/mcs/mcs/cfold.cs =================================================================== --- trunk/mcs/mcs/cfold.cs 2008-02-19 16:50:50 UTC (rev 96163) +++ trunk/mcs/mcs/cfold.cs 2008-02-19 16:56:56 UTC (rev 96164) @@ -58,9 +58,15 @@ if (left is EmptyConstantCast) return BinaryFold (ec, oper, ((EmptyConstantCast)left).child, right, loc); + if (left is SideEffectConstant) + return BinaryFold (ec, oper, ((SideEffectConstant) left).left, right, loc); + if (right is EmptyConstantCast) return BinaryFold (ec, oper, left, ((EmptyConstantCast)right).child, loc); + if (right is SideEffectConstant) + return BinaryFold (ec, oper, left, ((SideEffectConstant) right).left, loc); + Type lt = left.Type; Type rt = right.Type; bool bool_res; Modified: trunk/mcs/mcs/constant.cs =================================================================== --- trunk/mcs/mcs/constant.cs 2008-02-19 16:50:50 UTC (rev 96163) +++ trunk/mcs/mcs/constant.cs 2008-02-19 16:56:56 UTC (rev 96164) @@ -1761,7 +1761,7 @@ /// </summary> public class SideEffectConstant : Constant { - Constant left; + public Constant left; Expression right; public SideEffectConstant (Constant left, Expression right, Location loc) : base (loc) _______________________________________________ Mono-patches maillist - Mono-patches@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-patches