2007-11-20 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / corlib / System.Reflection.Emit / ParameterBuilder.cs
index 17b0f11ee128f873fffe65fb12382b59a3b24b86..2832768238a5763903d68b2bda0bdc027e471c08 100644 (file)
@@ -46,7 +46,7 @@ namespace System.Reflection.Emit {
 #endif
        [ClassInterface (ClassInterfaceType.None)]
        public class ParameterBuilder : _ParameterBuilder {
-               private MethodBase methodb; /* MethodBuilder or ConstructorBuilder */
+               private MethodBase methodb; /* MethodBuilder, ConstructorBuilder or DynamicMethod */
                private string name;
                private CustomAttributeBuilder[] cattrs;
                private UnmanagedMarshal marshal_info;
@@ -60,7 +60,12 @@ namespace System.Reflection.Emit {
                        position = pos;
                        attrs = attributes;
                        methodb = mb;
-                       table_idx = mb.get_next_table_index (this, 0x08, true);
+#if NET_2_0
+                       if (mb is DynamicMethod)
+                               table_idx = 0;
+                       else
+#endif
+                               table_idx = mb.get_next_table_index (this, 0x08, true);
                }
 
                public virtual int Attributes {