2003-02-28 Zoltan Varga <vargaz@freemail.hu>
authorZoltan Varga <vargaz@gmail.com>
Fri, 28 Feb 2003 18:41:17 +0000 (18:41 -0000)
committerZoltan Varga <vargaz@gmail.com>
Fri, 28 Feb 2003 18:41:17 +0000 (18:41 -0000)
* ILGenerator.cs (Emit): Add fixup for already created methods and
fields. Do not add fixup for types since their table index do not
change any more.

svn path=/trunk/mcs/; revision=12067

mcs/class/corlib/System.Reflection.Emit/ChangeLog
mcs/class/corlib/System.Reflection.Emit/ILGenerator.cs

index ac50b513dc91686f6d484b3d9436809953df2523..df28513f18bda592d09ec055b7d266202ff1cd8c 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
+
+       * ILGenerator.cs (Emit): Add fixup for already created methods and
+       fields. Do not add fixup for types since their table index do not 
+       change any more.
+
 2003-02-26  Zoltan Varga  <vargaz@freemail.hu>
 
        * TypeBuilder.cs (DefineInitializedData): Removed unnecessary assignments.
index 8377a6da820d9c56049791411316642b99e37afa..aca093cc316d57a734c3c08a6ebe7f723e044ed3 100644 (file)
@@ -353,7 +353,7 @@ namespace System.Reflection.Emit {
                        int token = abuilder.GetToken (constructor);
                        make_room (6);
                        ll_emit (opcode);
-                       if (constructor is ConstructorBuilder)
+                       if (constructor.DeclaringType.Module == module)
                                add_token_fixup (constructor);
                        emit_int (token);
                        ParameterInfo[] mparams = constructor.GetParameters();
@@ -382,7 +382,7 @@ namespace System.Reflection.Emit {
                        int token = abuilder.GetToken (field);
                        make_room (6);
                        ll_emit (opcode);
-                       if (field is FieldBuilder)
+                       if (field.DeclaringType.Module == module)
                                add_token_fixup (field);
                        emit_int (token);
                }
@@ -511,7 +511,7 @@ namespace System.Reflection.Emit {
                        int token = abuilder.GetToken (method);
                        make_room (6);
                        ll_emit (opcode);
-                       if (method is MethodBuilder)
+                       if (method.DeclaringType.Module == module)
                                add_token_fixup (method);
                        emit_int (token);
                        if (method.ReturnType != void_type)
@@ -556,8 +556,6 @@ namespace System.Reflection.Emit {
                public virtual void Emit (OpCode opcode, Type type) {
                        make_room (6);
                        ll_emit (opcode);
-                       if (type is TypeBuilder)
-                               add_token_fixup (type);
                        emit_int (abuilder.GetToken (type));
                }