[Mono-bugs] [Bug 27717][Maj] New - unsafe support broken

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
12 Jul 2002 16:40:08 -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 lupus@ximian.com.

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

--- shadow/27717	Fri Jul 12 12:40:08 2002
+++ shadow/27717.tmp.23168	Fri Jul 12 12:40:08 2002
@@ -0,0 +1,35 @@
+Bug#: 27717
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lupus@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: unsafe support broken
+
+The following test doesn't compile with mcs --unsafe unsafe.cs:
+unsafe.cs(9) error CS0214: Pointers may only be used in an unsafe context
+It compiles fine with csc. It's a blocker in corlib compilation.
+using System;        
+public class ghbn {
+
+	static void Main() {
+	    sbyte[] bbuf = new sbyte [255];
+	    string s;
+	    unsafe {
+		    fixed (sbyte *ss=&bbuf[0]) {
+			    s = new string (ss);
+		    }
+	    }
+            Console.WriteLine("name: {0}", s);
+         }
+}