[Mono-bugs] [Bug 63085][Nor] New - Bitwise shift might return an incorrect value.
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sat, 14 Aug 2004 16:12:45 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by agallero@netscape.net.
http://bugzilla.ximian.com/show_bug.cgi?id=63085
--- shadow/63085 2004-08-14 16:12:45.000000000 -0400
+++ shadow/63085.tmp.21841 2004-08-14 16:12:45.000000000 -0400
@@ -0,0 +1,54 @@
+Bug#: 63085
+Product: Mono: Runtime
+Version: unspecified
+OS: SUSE 9.1
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: agallero@netscape.net
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Bitwise shift might return an incorrect value.
+
+Description of Problem:
+Mono 1.01.
+
+Sometimes the ">>" operator might return invalid values.
+On the case:
+
+using System;
+
+public class Class1
+{
+ [STAThread]
+ static void Main(string[] args)
+ {
+ long a=0; int b=6; UInt16 c=3;
+ Console.WriteLine((a>>(b-c)).ToString());
+ }
+}
+
+the result is not 0.
+Steps to reproduce the problem:
+1. Compile and run the example above.
+
+Actual Results:
+ 134277360, on my machine.
+
+Expected Results:
+ 0
+
+How often does this happen?
+ Always.
+
+Additional Information:
+ It seems to be an error on the runtime, because the same compiled file
+runs well on the .NET framework. That is, I compile the file with mcs and
+get this result when running it with "mono test.exe". If I copy the file to
+windows and run it under .NET framework it works fine.