[Mono-bugs] [Bug 27311][Nor] Changed - checked{} does not always use .ovf opcodes
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
2 Jul 2002 07:43:23 -0000
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 lupus@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=27311
--- shadow/27311 Mon Jul 1 17:33:18 2002
+++ shadow/27311.tmp.6109 Tue Jul 2 03:43:23 2002
@@ -1,23 +1,23 @@
Bug#: 27311
-Product: Mono/Runtime
+Product: Mono/MCS
Version: unspecified
-OS:
+OS: unknown
OS Details: LFS
-Status: NEW
+Status: ASSIGNED
Resolution:
-Severity:
-Priority: Wishlist
-Component: misc
+Severity: Unknown
+Priority: Normal
+Component: Misc
AssignedTo: mono-bugs@ximian.com
ReportedBy: mwh@sysrq.dk
QAContact: mono-bugs@ximian.com
TargetMilestone: ---
URL:
Cc:
-Summary: checked{} does not generate any exception
+Summary: checked{} does not always use .ovf opcodes
Description of Problem:
The language construct checked seems to have no effect. No exception is
throwned.
@@ -50,6 +50,26 @@
An OverflowException
How often does this happen?
Everytime
Additional Information:
+
+------- Additional Comments From lupus@ximian.com 2002-07-02 03:43 -------
+Thanks for the test. This turns out to be a compiler issue:
+mcs uses the correct .ovf variants when doing the computations, but
+not when converting the value back to byte (the eval stack uses 32 bit
+ints).
+Example code produced by csc:
+ IL_0014: ldloc.0
+ IL_0015: ldloc.1
+ IL_0016: sub.ovf
+ IL_0017: conv.ovf.u1
+ IL_0018: stloc.2
+The same code produced by mcs:
+ IL_0014: ldloc.0
+ IL_0015: ldloc.1
+ IL_0016: sub.ovf
+ IL_0017: conv.u1
+ IL_0018: stloc.2
+(note the conv opcode).
+The csc compiled program works fine in both mono and mint.