[Mono-bugs] [Bug 43730][Nor] New - address of unfixed expression only allowed in fixed context
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Tue, 27 May 2003 11:07:03 -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 lupus@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=43730
--- shadow/43730 Tue May 27 11:07:03 2003
+++ shadow/43730.tmp.2004 Tue May 27 11:07:03 2003
@@ -0,0 +1,34 @@
+Bug#: 43730
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: lupus@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: address of unfixed expression only allowed in fixed context
+
+mcs compiles the following program (mcs /unsafe ...), but it should not.
+csc reports:
+address-of-unfixed.cs(5,12): error CS0212: You can only take the address of
+unfixed expression inside of a fixed statement initializer
+
+using System;
+
+unsafe struct Foo {
+ public void Enter () {
+ Foo *o = &this;
+ }
+ public static void Main () {
+ Foo f = new Foo ();
+ f.Enter ();
+ }
+}