[Mono-bugs] [Bug 27751][Maj] New - Invoking an static method fails with the JIT

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
13 Jul 2002 16:28:13 -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 gonzalo@ximian.com.

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

--- shadow/27751	Sat Jul 13 12:28:13 2002
+++ shadow/27751.tmp.1638	Sat Jul 13 12:28:13 2002
@@ -0,0 +1,55 @@
+Bug#: 27751
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Invoking an static method fails with the JIT
+
+Description of Problem:
+I call GetValue (null, null) on a PropertyInfo. The property is static.
+It does not work with mono and works with mint
+
+
+Steps to reproduce the problem:
+1. compile whis program referencing System.Drawing and run
+using System;
+using System.Drawing;
+using System.Reflection;
+
+public class MyClass
+{
+        public static void Main (string [] args)
+        {
+                Type t = typeof (Color);
+                PropertyInfo [] props = t.GetProperties ();
+                foreach (PropertyInfo prop in props){
+                        if (prop.Name == "Red"){
+                                Console.WriteLine ("{0}", prop.GetValue
+(null, null));
+                                break;
+                        }
+                }
+        }
+}
+
+
+Actual Results:
+(process:1516): ** WARNING **: unhandled exception
+System.NullReferenceException: "A null value was found wher
+e an object instance was required"
+in <0x00062> (runtime invoke wrapper) .MyClass:Main (object,intptr,intptr)
+
+Expected Results:
+Color [Red]
+(though there is a bug in the library that makes it output [255,255,0,0]