Bug 317074 (MONO72080) - [PATCH] The runtime is improperly byte ordering static arrays of enum values
Summary: [PATCH] The runtime is improperly byte ordering static arrays of enum values
Status: RESOLVED FIXED
Alias: MONO72080
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Enhancement
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-02 01:12 UTC by Geoff Norton
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
patch (602 bytes, patch)
2005-02-02 01:13 UTC, Thomas Wiest
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:06:04 UTC


---- Reported by grompf@sublimeintervention.com 2005-02-01 18:12:51 MST ----

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



---- Additional Comments From grompf@sublimeintervention.com 2005-02-01 18:13:41 MST ----

Created an attachment (id=167340)
patch




---- Additional Comments From miguel@ximian.com 2005-02-01 18:18:39 MST ----

Paolo, could you review and approve this?

Geoff would like this on the 1.1.4 tarballs.



---- Additional Comments From lupus@ximian.com 2005-02-02 09:14:36 MST ----

Committed to svn, thanks for the patch.

Imported an attachment (id=167340)

Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>OSX 10.3.7</cf_op_sys_details>
Unknown operating system unknown. Setting to default OS "Other".