[Mono-bugs] [Bug 72080][Wis] New - [PATCH] The runtime is improperly byte ordering static arrays of enum values

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 1 Feb 2005 18:12:51 -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 grompf@sublimeintervention.com.

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

--- shadow/72080	2005-02-01 18:12:51.000000000 -0500
+++ shadow/72080.tmp.21448	2005-02-01 18:12:51.000000000 -0500
@@ -0,0 +1,61 @@
+Bug#: 72080
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: OSX 10.3.7
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: grompf@sublimeintervention.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [PATCH] The runtime is improperly byte ordering static arrays of enum values
+
+The following testcase:
+using System;
+using System.Text;
+
+class A {
+
+        enum Val {
+                A,
+                B,
+                C,
+                D
+        }
+
+        static Val[] Corrupted = {
+                Val.A,
+                Val.B,
+                Val.C,
+                Val.D,
+        };
+
+        static void Main (string [] args) {
+                foreach (Val v in Corrupted)
+                        Console.WriteLine ("{0}", v);
+        }
+}
+
+Currenty prints:
+junglist:~/Documents/Development/mono/bugs plasma$ mcs test2.cs ; mono -O=-all test2.exe
+A
+16777216
+33554432
+50331648
+
+With the attached patch it prints:
+junglist:~/Documents/Development/mono/bugs plasma$ mcs test2.cs ; mono -O=-all test2.exe
+A
+B
+C
+D
+
+This patch also resolve ~10 failures int he corlib test suite on big endian machines.
+
+-kangaroo