[Mono-bugs] [Bug 38674][Nor] Changed - TimeSpan.MinValue.Negate () does not throw

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 23 Dec 2003 21:37:40 -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=38674

--- shadow/38674	2003-07-24 12:15:54.000000000 -0400
+++ shadow/38674.tmp.11166	2003-12-23 21:37:40.000000000 -0500
@@ -1,16 +1,16 @@
 Bug#: 38674
-Product: Mono/MCS
+Product: Mono/Compilers
 Version: unspecified
 OS: Red Hat 8.0
 OS Details: 
 Status: NEW   
 Resolution: 
 Severity: Unknown
 Priority: Normal
-Component: Misc
+Component: C#
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: ndrochak@gol.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Summary: TimeSpan.MinValue.Negate () does not throw
@@ -97,6 +97,38 @@
 
 Under MS runtime, it throws an OverflowException.
 Under mono runtime, it prints:
 -9223372036854775808
 -9223372036854775808
 
+
+------- Additional Comments From bmaurer@users.sf.net  2003-12-23 21:37 -------
+Ok, so on MCS we emit
+    IL_0000:  ldc.i8     0x8000000000000000
+    IL_0009:  stloc.0
+    IL_000a:  ldloc.0
+    IL_000b:  neg
+    IL_000c:  stloc.1
+    IL_000d:  ldloc.0
+    IL_000e:  call       void [mscorlib]System.Console::WriteLine
+(int64)
+    IL_0013:  ldloc.1
+    IL_0014:  call       void [mscorlib]System.Console::WriteLine
+(int64)
+    IL_0019:  ret
+
+CSC emits
+
+    IL_0000:  ldc.i8     0x8000000000000000
+    IL_0009:  stloc.0
+    IL_000a:  ldc.i4.0
+    IL_000b:  conv.i8
+    IL_000c:  ldloc.0
+    IL_000d:  sub.ovf
+    IL_000e:  stloc.1
+    IL_000f:  ldloc.0
+    IL_0010:  call       void [mscorlib]System.Console::WriteLine
+(int64)
+    IL_0015:  ldloc.1
+    IL_0016:  call       void [mscorlib]System.Console::WriteLine
+(int64)
+    IL_001b:  ret