Author: raja
Date: 2006-06-21 07:02:12 -0400 (Wed, 21 Jun 2006)
New Revision: 61898

Added:
   trunk/mcs/errors/cs0019-16.cs
Modified:
   trunk/mcs/errors/ChangeLog
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/expression.cs
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/expression.cs
Log:
Fix #78662
* mcs/expression.cs (Binary.CheckShiftArguments): Don't overwrite original
'left' and 'right' before error-checking.
* gmcs/expression.cs: Likewise.
* errors/cs0019-16.cs: New test from #78662.


Modified: trunk/mcs/errors/ChangeLog
===================================================================
--- trunk/mcs/errors/ChangeLog  2006-06-21 10:41:07 UTC (rev 61897)
+++ trunk/mcs/errors/ChangeLog  2006-06-21 11:02:12 UTC (rev 61898)
@@ -1,3 +1,7 @@
+2006-06-21  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       * cs0019-16.cs: New test from #78662.
+
 2006-06-16  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * cs0120-9.cs: New test from #78601.

Added: trunk/mcs/errors/cs0019-16.cs
===================================================================
--- trunk/mcs/errors/cs0019-16.cs       2006-06-21 10:41:07 UTC (rev 61897)
+++ trunk/mcs/errors/cs0019-16.cs       2006-06-21 11:02:12 UTC (rev 61898)
@@ -0,0 +1,11 @@
+// cs0019-16.cs: Operator `<<' cannot be applied to operands of type `byte' 
and `uint'
+// Line: 9
+
+using System;
+public class PerformanceTest2 {
+       public static void Main () {
+               uint j, k;
+               j = 0;
+               k = ((byte) 1 << (7 - j % 8));
+       }
+}


Property changes on: trunk/mcs/errors/cs0019-16.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2006-06-21 10:41:07 UTC (rev 61897)
+++ trunk/mcs/gmcs/ChangeLog    2006-06-21 11:02:12 UTC (rev 61898)
@@ -1,3 +1,9 @@
+2006-06-21  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       Fix #78662
+       * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
+       'left' and 'right' before error-checking.
+
 2006-06-19  Martin Baulig  <[EMAIL PROTECTED]>
 
        * convert.cs

Modified: trunk/mcs/gmcs/expression.cs
===================================================================
--- trunk/mcs/gmcs/expression.cs        2006-06-21 10:41:07 UTC (rev 61897)
+++ trunk/mcs/gmcs/expression.cs        2006-06-21 11:02:12 UTC (rev 61898)
@@ -1641,15 +1641,16 @@
                                        
                Expression CheckShiftArguments (EmitContext ec)
                {
-                       left = Make32or64 (ec, left);
-                       right = ForceConversion (ec, right, 
TypeManager.int32_type);
-                       if (left == null || right == null) {
+                       Expression new_left = Make32or64 (ec, left);
+                       Expression new_right = ForceConversion (ec, right, 
TypeManager.int32_type);
+                       if (new_left == null || new_right == null) {
                                Error_OperatorCannotBeApplied ();
                                return null;
                        }
-                       type = left.Type;
+                       type = new_left.Type;
                        int shiftmask = (type == TypeManager.int32_type || type 
== TypeManager.uint32_type) ? 31 : 63;
-                       right = new Binary (Binary.Operator.BitwiseAnd, right, 
new IntConstant (shiftmask, loc)).DoResolve (ec);
+                       left = new_left;
+                       right = new Binary (Binary.Operator.BitwiseAnd, 
new_right, new IntConstant (shiftmask, loc)).DoResolve (ec);
                        return this;
                }
 

Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2006-06-21 10:41:07 UTC (rev 61897)
+++ trunk/mcs/mcs/ChangeLog     2006-06-21 11:02:12 UTC (rev 61898)
@@ -1,3 +1,9 @@
+2006-06-21  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       Fix #78662
+       * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
+       'left' and 'right' before error-checking.
+
 2006-06-16  Juraj Skripsky  <[EMAIL PROTECTED]>
 
        * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the 
name.

Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2006-06-21 10:41:07 UTC (rev 61897)
+++ trunk/mcs/mcs/expression.cs 2006-06-21 11:02:12 UTC (rev 61898)
@@ -1596,15 +1596,16 @@
                                        
                Expression CheckShiftArguments (EmitContext ec)
                {
-                       left = Make32or64 (ec, left);
-                       right = ForceConversion (ec, right, 
TypeManager.int32_type);
-                       if (left == null || right == null) {
+                       Expression new_left = Make32or64 (ec, left);
+                       Expression new_right = ForceConversion (ec, right, 
TypeManager.int32_type);
+                       if (new_left == null || new_right == null) {
                                Error_OperatorCannotBeApplied ();
                                return null;
                        }
-                       type = left.Type;
+                       type = new_left.Type;
                        int shiftmask = (type == TypeManager.int32_type || type 
== TypeManager.uint32_type) ? 31 : 63;
-                       right = new Binary (Binary.Operator.BitwiseAnd, right, 
new IntConstant (shiftmask, loc)).DoResolve (ec);
+                       left = new_left;
+                       right = new Binary (Binary.Operator.BitwiseAnd, 
new_right, new IntConstant (shiftmask, loc)).DoResolve (ec);
                        return this;
                }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to