[Mono-bugs] [Bug 440785] New: Mono runtime complains about invalid IL generated by gmcs
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Fri Oct 31 19:58:34 EDT 2008
https://bugzilla.novell.com/show_bug.cgi?id=440785
Summary: Mono runtime complains about invalid IL generated by
gmcs
Product: Mono: Compilers
Version: 2.0
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: mtraudt at quantifisolutions.com
QAContact: mono-bugs at lists.ximian.com
Found By: ---
The code below compiles with gmcs v2.0.1.0 but gets the following runtime error
when run with mono v2.0.1 on OpenSUSE 11:
Unhandled Exception: System.InvalidProgramException: Invalid IL code in
OneOff:Clone (double[]): IL_0078: box 0x1b000001
Exact same exe runs fine with MS CLR 2.0 on Windows, so seems to be less about
the code generated than about the runtime.
using System;
public class OneOff
{
public static void Main(string[] args)
{
double[] darray = { 1.0, 2.0, 3.0 };
double[] clone = OneOff.Clone(darray);
Console.WriteLine(clone.Length);
}
private static T[] Clone<T>(T[] o)
{
if (o == null)
return null;
Type t = typeof(T);
if (t.IsValueType)
return (T[])o.Clone();
else if (t.IsArray && (t.GetElementType().IsValueType ||
t.GetElementType()==typeof(string)))
{
T[] copy = new T[o.Length];
for (int i = 0; i < o.Length; i++)
copy[i] = (T)(o[i] as Array).Clone();
return copy;
}
else
throw new ArgumentException("oops");
}
}
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list