[Mono-bugs] [Bug 42031][Blo] New - delegates in unsafe context compiles without unsafe modifier

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Mon, 28 Apr 2003 12:39:21 -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 r.h.lee@attbi.com.

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

--- shadow/42031	Mon Apr 28 12:39:21 2003
+++ shadow/42031.tmp.25586	Mon Apr 28 12:39:21 2003
@@ -0,0 +1,44 @@
+Bug#: 42031
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: r.h.lee@attbi.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: delegates in unsafe context compiles without unsafe modifier
+
+Description:
+
+using System;
+
+public class App {
+/*1*/	public delegate int 	testArgPtr (void* aptr);
+/*2*/	public delegate void*	testRetPtr ();
+/*3*/	public delegate void*   testBotPtr (void* aptr);
+
+	public static void Main (string[] args) {}
+}
+
+Actual Results:
+Compiled successful
+
+Expected Results:
+error CS0214: Pointers may only be used in an unsafe context
+
+Additional Information:
+C# Language Specification; A.1 Unsafe contexts
+C# Language Specification; A.2 Pointer Types
+
+http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csspec/html/vclrfcsharpspec_A.asp
+
+To big of trace output to place here, use "mono --trace /usr/bin/mcs.exe
+unsafedelegate.cs" for tracing.