do not check order sequence if option /order was not used
[mono.git] / mono / metadata / object.c
index 04dc219207dc56c3201247d0b77b8e8853957f5c..a1e1f884125bda056e5e0019dec2fa92c7404f80 100644 (file)
@@ -1999,21 +1999,23 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean
                                gsize default_bitmap [4] = {0};
                                gsize *bitmap;
                                int max_set = 0;
+                               int numbits;
                                MonoClass *fclass;
                                if (mono_type_is_reference (field->type)) {
                                        default_bitmap [0] = 1;
-                                       max_set = 1;
+                                       numbits = 1;
                                        bitmap = default_bitmap;
                                } else if (mono_type_is_struct (field->type)) {
                                        fclass = mono_class_from_mono_type (field->type);
                                        bitmap = compute_class_bitmap (fclass, default_bitmap, sizeof (default_bitmap) * 8, 0, &max_set, FALSE);
+                                       numbits = max_set + 1;
                                } else {
                                        default_bitmap [0] = 0;
-                                       max_set = 0;
+                                       numbits = 0;
                                        bitmap = default_bitmap;
                                }
                                size = mono_type_size (field->type, &align);
-                               offset = mono_alloc_special_static_data (special_static, size, align, (uintptr_t*)bitmap, max_set);
+                               offset = mono_alloc_special_static_data (special_static, size, align, (uintptr_t*)bitmap, numbits);
                                if (!domain->special_static_fields)
                                        domain->special_static_fields = g_hash_table_new (NULL, NULL);
                                g_hash_table_insert (domain->special_static_fields, field, GUINT_TO_POINTER (offset));
@@ -4944,7 +4946,7 @@ mono_string_new_len (MonoDomain *domain, const char *text, guint length)
        guint16 *ut;
        glong items_written;
 
-       ut = g_utf8_to_utf16 (text, length, NULL, &items_written, &error);
+       ut = eg_utf8_to_utf16_with_nuls (text, length, NULL, &items_written, &error);
 
        if (!error)
                o = mono_string_new_utf16 (domain, ut, items_written);