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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=82848 --- shadow/82848 2007-09-14 05:00:22.000000000 -0400 +++ shadow/82848.tmp.2136 2007-09-14 05:00:22.000000000 -0400 @@ -0,0 +1,53 @@ +Bug#: 82848 +Product: Mono: Class Libraries +Version: 1.2 +OS: +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Normal +Component: CORLIB +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: GCHandle.AddrOfPinnedObject() exception instead of returning a value. + +Description of Problem: +GCHandle.AddrOfPinnedObject() throws exception if it has been allocated for +an object with a value of null. + + +Steps to reproduce the problem: +Use the following code: + +object nullObj = null; +GCHandle handle = GCHandle.Alloc(nullObj, GCHandleType.Pinned); +try +{ + IntPtr ptr = handle.AddrOfPinnedObject(); + Console.WriteLine(ptr); +} +finally +{ + handle.Free(); +} + +Actual Results: +Unhandled Exception: System.InvalidOperationException: The handle is not of +Pinned type + at System.Runtime.InteropServices.GCHandle.AddrOfPinnedObject () [0x00000] + +Expected Results: +The variable gets a value of zero. "0" gets printed onto screen. + + +How often does this happen? +Always + +Additional Information: +Happens with Mono 1.2.5. Shows expected results on MS .Net 2.0. +Untested under Linux. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
