[Mono-bugs] [Bug 46723][Nor] New - mcs does not allow unfixed & operator to be applied to local struct members

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Tue, 22 Jul 2003 11:51:22 -0400 (EDT)


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 vargaz@freemail.hu.

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

--- shadow/46723	Tue Jul 22 11:51:22 2003
+++ shadow/46723.tmp.32295	Tue Jul 22 11:51:22 2003
@@ -0,0 +1,39 @@
+Bug#: 46723
+Product: Mono/MCS
+Version: unspecified
+OS: Debian Woody
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vargaz@freemail.hu               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs does not allow unfixed & operator to be applied to local struct members
+
+mcs refuses to compile the following (valid) program:
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+using System;
+
+public unsafe struct AStruct {
+
+	int foo;
+
+	public static void Main (String[] args) {
+		AStruct s;
+		int *ptr = &s.foo;
+	}
+}
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+It prints the following error message:
+bug-mcs-fixed.cs(9) error CS0212: You can only take the address of an
+unfixed expression inside of a fixed statement initializer
+
+According to the C# spec, section 25.3, s.foo is a fixed variable so its
+address can be taken outside a fixed block.