[Mono-bugs] [Bug 28562][Nor] Changed - type info lost with enum arguments to a custom attr that takes an object

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
6 Aug 2002 15:37:27 -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 martin@gnome.org.

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

--- shadow/28562	Tue Aug  6 10:17:15 2002
+++ shadow/28562.tmp.8955	Tue Aug  6 11:37:27 2002
@@ -40,6 +40,35 @@
 The file is right there in cvs, I'm attaching it here anyway, just to bloat bugzilla.
 
 
 ------- Additional Comments From martin@gnome.org  2002-08-06 10:17 -------
 Oh, I was blind - I looked in mcs/tests, not in mono/tests ....
 
+
+------- Additional Comments From martin@gnome.org  2002-08-06 11:37 -------
+Ok, I debugged this.
+
+The crash with the ms runtime is a stack overflow in the 
+CustomAttributeBuilder's constructor.  It is called with these 
+arguments (which look ok to me):
+
+NEW CB: 
+.ctor,My,My,System.Object[](System.Enum),System.Reflection.PropertyInfo[](),System.Object[](),System.Reflection.FieldInfo[](),System.Object[]()
+
+So I think this is a bug in the ms runtime.
+
+About the miscompilation issue: what happens if the enum is a 
+dynamic type ?
+
+	enum Foo { A, B }
+
+	[My(Foo.A)]
+	class T { ... }
+
+	class My : Attribute {
+		public object obj;
+		public My (object o) {
+			obj = o;
+		}
+	}
+
+If the enum is a dynamic type, then I can't create an instance of it.