Merge pull request #498 from Unroll-Me/master
[mono.git] / mono / metadata / metadata.c
index 5a12af08f87d5383589eb67868e3c2c0f1a1a782..7f5a1757a1b20e18db2f9fe52e09f0936f592e36 100644 (file)
@@ -757,7 +757,6 @@ mono_metadata_compute_size (MonoImage *meta, int tableindex, guint32 *result_bit
                        n = MAX (n, meta->tables [MONO_TABLE_METHOD].rows);
                        n = MAX (n, meta->tables [MONO_TABLE_MODULEREF].rows);
                        n = MAX (n, meta->tables [MONO_TABLE_TYPESPEC].rows);
-                       n = MAX (n, meta->tables [MONO_TABLE_MEMBERREF].rows);
 
                        /* 3 bits to encode */
                        field_size = rtsize (n, 16 - 3);
@@ -4287,12 +4286,7 @@ mono_type_size (MonoType *t, int *align)
                return 4;
        case MONO_TYPE_I8:
        case MONO_TYPE_U8:
-#if defined(__APPLE__) && SIZEOF_VOID_P==4
-               /* xcode 4.3 llvm-gcc bug */
-               *align = 4;
-#else          
                *align = abi__alignof__(gint64);
-#endif
                return 8;               
        case MONO_TYPE_R8:
                *align = abi__alignof__(double);
@@ -4599,6 +4593,8 @@ mono_metadata_generic_param_equal (MonoGenericParam *p1, MonoGenericParam *p2, g
                return TRUE;
        if (mono_generic_param_num (p1) != mono_generic_param_num (p2))
                return FALSE;
+       if (p1->serial != p2->serial)
+               return FALSE;
 
        /*
         * We have to compare the image as well because if we didn't,
@@ -4644,6 +4640,9 @@ mono_metadata_class_equal (MonoClass *c1, MonoClass *c2, gboolean signature_only
        if (signature_only &&
            (c1->byval_arg.type == MONO_TYPE_SZARRAY) && (c2->byval_arg.type == MONO_TYPE_SZARRAY))
                return mono_metadata_class_equal (c1->byval_arg.data.klass, c2->byval_arg.data.klass, signature_only);
+       if (signature_only &&
+           (c1->byval_arg.type == MONO_TYPE_ARRAY) && (c2->byval_arg.type == MONO_TYPE_ARRAY))
+               return do_mono_metadata_type_equal (&c1->byval_arg, &c2->byval_arg, signature_only);
        return FALSE;
 }