Mono VM reports valid IL as invalid
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mono |
Fix Released
|
Unknown
|
|||
mono (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
The code below runs fine on MS .net, but fails in mono in ubuntu. I've compiled with both MS C# compiler, csc.exe, and with mono's mcs, both compiles fine, but mono cannot run the applications.
Mono gives this error when running the mcs compiled code:
Unhandled Exception: System.
And a almost identical when running the csc compiled one:
Unhandled Exception: System.
..
As I said, when executed on MS Windows in MS .net the csc compiled code runs fine.
Here is the C# code that causes the errors:
/* This class works fine */
public class Works {
private double val;
public double this[int i, int j] {
get { return val; }
set { val = value; }
}
public Works(double val)
{ this.val = val; }
}
/* Same code as struct breaks */
public struct Breaks {
private double val;
public double this[int i, int j] {
get { return val; }
set { val = value; }
}
public Breaks(double val)
{ this.val = val; }
}
public class Tester {
public static void Main(string[] args)
{
Works w = new Works(3.0);
w[0, 0] += 3.0;
Breaks b = new Breaks(3.0);
b[0, 0] += 3.0;
}
}
Changed in mono: | |
status: | Unknown → Fix Released |
Thanks for reporting this. I can reproduce this here with both mcs and gmcs and running with mono 1.2.2.1... I'll forward this upstream.