[Mono-bugs] [Bug 81848][Wis] New - checked fails to detect integer overflow

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Jun 10 11:07:33 EDT 2007


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 zerberous at googlemail.com.

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

--- shadow/81848	2007-06-10 11:07:33.000000000 -0400
+++ shadow/81848.tmp.19941	2007-06-10 11:07:33.000000000 -0400
@@ -0,0 +1,82 @@
+Bug#: 81848
+Product: Mono: Compilers
+Version: 1.2
+OS: 
+OS Details: 2.6.20-16-generic #2 SMP - ubuntu feisty
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Wishlist
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: zerberous at googlemail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: checked fails to detect integer overflow
+
+Description of Problem:
+
+checked fails with integer overflow.
+
+
+Steps to reproduce the problem:
+
+Create project gtk, in mono-develop,
+enter following app:
+
+---------------------------------
+// project created on 6/9/2007 at 10:51 PM
+using System;
+using Gtk;
+
+namespace test2
+{
+	class MainClass
+	{
+		public static void Main (string[] args)
+		{
+			checked { 
+				int i=int.MaxValue;
+				i=+10000; 
+				Console.Write("not catched : " + i + "\n");
+			}
+			
+			checked { 
+				int i=int.MaxValue;
+				i=i+10000; 
+				Console.Write("catched : " + i + "\n");
+			}
+			
+			Application.Init ();
+			MainWindow win = new MainWindow ();
+			win.Show ();
+			Application.Run ();
+			
+		}
+	}
+}
+---------------------------------
+
+
+
+
+Actual Results:
+
+not catched : 10000
+catched : -2147473649
+
+
+Expected Results:
+
+an overflow exception
+
+
+How often does this happen? 
+
+always
+
+Additional Information:
+
+debug target in mono-develop selected


More information about the mono-bugs mailing list