[runtime] Emit the necessary left shift anding in the LambdaCompiler
[mono.git] / mcs / class / dlr / Runtime / Microsoft.Scripting.Core / Compiler / LambdaCompiler.Binary.cs
index a089b81222dbe6bee0fc3f37fafe6c16f0ef4b0f..3c9ec62326ebec9c3bac530b44415aacaa4a0e2c 100644 (file)
@@ -275,6 +275,12 @@ namespace System.Linq.Expressions.Compiler {
                     if (rightType != typeof(int)) {
                         throw ContractUtils.Unreachable;
                     }
+                    // Note: If this code is made to handle unsigned
+                    // rightType types, emit the following when rightType:
+                    // is unsigned
+                    //_ilg.EmitInt(0x3f);
+                    _ilg.EmitInt(0x1f);
+                    _ilg.Emit(OpCodes.And);
                     _ilg.Emit(OpCodes.Shl);
                     break;
                 case ExpressionType.RightShift: