[Mono-bugs] [Bug 36055][Wis] Changed - Taking the address of unfixed expression should not compile

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Fri, 17 Jan 2003 02:28:36 -0500 (EST)


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 gonzalo@ximian.com.

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

--- shadow/36055	Mon Dec 23 08:12:37 2002
+++ shadow/36055.tmp.22682	Fri Jan 17 02:28:36 2003
@@ -1,23 +1,22 @@
 Bug#: 36055
-Product: Mono/Runtime
+Product: Mono/MCS
 Version: unspecified
 OS: other
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Wishlist
-Component: misc
+Component: Misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: raciel@es.gnu.org               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
-Cc: 
-Summary: Pointers error: Dont update the true value.
+Summary: Taking the address of unfixed expression should not compile
 
 I have made the following pointers sample and when I assign *p=3 it might
 update the d.x value but when I write d.x it prints 4 value instead 3.
 
 using System;
 
@@ -32,6 +31,17 @@
                         CData d=new CData();
                         int *p=&d.x;
                         *p=3;
                         Console.WriteLine ("{0}", d.x);
                 }
 }
+
+------- Additional Comments From gonzalo@ximian.com  2003-01-17 02:28 -------
+This does not compile with csc. It says:
+bug36055.cs(12,32): error CS0212: You can only take the address of
+unfixed expression inside of a fixed
+        statement initializer
+
+The right code in Main should be (it compiles with mcs):
+             CData d=new CData();
+             fixed (int *p=&d.x) *p=3;
+             Console.WriteLine ("{0}", d.x);