Bug 324950 (MONO82281) - [PPC] byte array + shift operation (+ foreach) causes NullReferenceException
Summary: [PPC] byte array + shift operation (+ foreach) causes NullReferenceException
Status: RESOLVED FIXED
Alias: MONO82281
Product: Mono: Runtime
Classification: Mono
Component: JIT (show other bugs)
Version: 1.0
Hardware: Other Linux
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Paolo Molaro
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-01 21:47 UTC by Atsushi Enomoto
Modified: 2007-09-15 21:24 UTC (History)
1 user (show)

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


Attachments

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


---- Reported by atsushi@ximian.com 2007-08-01 14:47:28 MST ----

(Forwarding a report wrt some weird NRE by Kazuki.)

Arch/Platform:
iMac G5 + gentoo + mono(trunk)

Code:

static void Main ()
{
    uint temp = 0;
    byte[] data = new byte[256];
    for (int i = 0; i < 1; i ++) // *1
        temp = (uint)(data[temp >> 24] | data[temp >> 0]); // *2
}

Actual Result:

Unhandled Exception: System.NullReferenceException: Object reference not
set to an instance of an object
  at test.Main () [0x00000] 

Additional Notes:

This does not happen when *1 is removed, or *2 is replaced with:

        temp = (uint)(data[temp >> 0] | data[temp >> 24]);



---- Additional Comments From lupus@ximian.com 2007-08-02 12:03:11 MST ----

Fixed in svn, thanks!