[Mono-bugs] [Bug 32253][Nor] New - MCS uses ldsflda for read-only instance fields

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
14 Oct 2002 10:51:50 -0000


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 martin@gnome.org.

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

--- shadow/32253	Mon Oct 14 06:51:50 2002
+++ shadow/32253.tmp.26249	Mon Oct 14 06:51:50 2002
@@ -0,0 +1,57 @@
+Bug#: 32253
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: martin@gnome.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: MCS uses ldsflda for read-only instance fields
+
+Here is a testcase:
+
+====
+using System;
+
+struct A
+{
+	long foo;
+
+	public A (long foo)
+	{
+		this.foo = foo;
+	}
+
+	public long Foo {
+		get {
+			return foo;
+		}
+	}
+}
+
+class X
+{
+	public readonly A a;
+
+	X ()
+	{
+		a = new A (6);
+		Console.WriteLine (a.Foo);
+	}
+
+	static void Main ()
+	{
+		X x = new X ();
+	}
+}
+=====
+
+MCS incorrectly uses ldsflda for the `a.Foo', but only if `a' is readonly.