[Mono-bugs] [Bug 70234][Nor] New - InterlockedIncrement on (long) 2147483647 returns wrong value

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 5 Dec 2004 16:21:17 -0500 (EST)


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 bmaurer@users.sf.net.

http://bugzilla.ximian.com/show_bug.cgi?id=70234

--- shadow/70234	2004-12-05 16:21:17.000000000 -0500
+++ shadow/70234.tmp.13428	2004-12-05 16:21:17.000000000 -0500
@@ -0,0 +1,37 @@
+Bug#: 70234
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: InterlockedIncrement on (long) 2147483647 returns wrong value
+
+[benm@omega benm]$ cat blah.cs
+using System;
+using System.Threading;
+ 
+class X {
+        static void Main () {
+                long l = 2147483647;
+                long ll = l + 1;
+                long res = Interlocked.Increment (ref l);
+ 
+                Console.WriteLine ("Expected       {0}", ll);
+                Console.WriteLine ("In the operand {0}", l);
+                Console.WriteLine ("Return value   {0}", res);
+        }
+}
+[benm@omega benm]$ mono blah.exe
+Expected       2147483648
+In the operand 2147483648
+Return value   -2147483648