[Mono-bugs] [Bug 36376][Nor] New - mcs produces different output for enums than csc
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Tue, 7 Jan 2003 03:19:00 -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 mathpup@mylinuxisp.com.
http://bugzilla.ximian.com/show_bug.cgi?id=36376
--- shadow/36376 Tue Jan 7 03:19:00 2003
+++ shadow/36376.tmp.20621 Tue Jan 7 03:19:00 2003
@@ -0,0 +1,88 @@
+Bug#: 36376
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: mathpup@mylinuxisp.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: mcs produces different output for enums than csc
+
+Description of Problem:
+
+The IL that mcs produces for enums differs from that of csc. Consider, for example,
+the code
+
+public class QFont
+{
+ public enum Weight {
+ Light = 25, Normal = 50, DemiBold = 63, Bold = 75, Black = 87 }
+}
+
+
+For the enum declaration, csc produces
+
+.class nested public auto sealed ansi Weight extends [mscorlib]System.Enum
+{
+ .field public specialname rtspecialname int32 value__
+ .field public static literal valuetype QFont/Weight Light = int32(0x00000019)
+ .field public static literal valuetype QFont/Weight Normal = int32(0x00000032)
+ .field public static literal valuetype QFont/Weight DemiBold =
+int32(0x0000003F)
+ .field public static literal valuetype QFont/Weight Bold = int32(0x0000004B)
+ .field public static literal valuetype QFont/Weight Black = int32(0x00000057)
+}
+
+whereas mcs produces
+
+.class nested public auto sealed ansi Weight extends [mscorlib]System.Enum
+{
+ .field public specialname rtspecialname int32 value__
+ .field public static literal int32 Light = int32(0x00000019)
+ .field public static literal int32 Normal = int32(0x00000032)
+ .field public static literal int32 DemiBold = int32(0x0000003F)
+ .field public static literal int32 Bold = int32(0x0000004B)
+ .field public static literal int32 Black = int32(0x00000057)
+}
+
+Note that the static fields have type "int32" in mcs's version but "valuetype" in csc's.
+In ECMA Partition II, Section 13.3, the normative text is not entirely clear on this
+point. However, the informative example closely resembles the output from csc,
+rather than from mcs:
+
+.class sealed public ErrorCodes extends [mscorlib]System.Enum
+{
+ .field public unsigned int 8 MyValue
+ .field public static literal valuetype ErrorCodes no_error = int8(0)
+ .field public static literal valuetype ErrorCodes format_error = int8(1)
+ .field public static literal valuetype ErrorCodes overflow_error = int8(2)
+ .field public static literal valuetype ErrorCodes nonpositive_error = int8(3)
+}
+
+Steps to reproduce the problem:
+1. Compile the attached to a library
+2. Disassemble the output
+3.
+
+Actual Results:
+
+N/A
+
+Expected Results:
+
+N/A
+
+How often does this happen?
+
+Always
+
+
+Additional Information: