You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Mark the bytes used by this fields type based on if it contains references or not.
1929
-
// Make sure there are no overlaps between object and non-object fields.
1930
-
for (intj=0; j<size; j++) {
1931
-
intchecked_byte=field_offset+j;
1932
-
g_assert(checked_byte<layout_size);
1933
-
1934
-
if (layout_check [checked_byte] !=0&&layout_check [checked_byte] !=type) {
1935
-
*invalid_field_offset=field_offset;
1936
-
return FALSE;
1937
-
}
1938
-
layout_check [checked_byte] =type;
1939
-
}
1940
-
}
1941
-
}
1942
-
1943
-
return TRUE;
1944
-
}
1945
-
1946
1867
/*
1947
1868
* mono_class_layout_fields:
1948
1869
* @class: a class
@@ -2233,12 +2154,29 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_
2233
2154
}
2234
2155
2235
2156
/* check for incorrectly aligned or overlapped by a non-object field */
2236
-
guint8*layout_check;
2157
+
guint8*layout_check;
2237
2158
if (has_references) {
2238
2159
layout_check=g_new0 (guint8, real_size);
2239
-
intinvalid_field_offset;
2240
-
if (!validate_struct_fields_overlaps (layout_check, real_size, klass, field_offsets, top, &invalid_field_offset)) {
2241
-
mono_class_set_type_load_failure (klass, "Could not load type '%s' because it contains an object field at offset %d that is incorrectly aligned or overlapped by a non-object field.", klass->name, invalid_field_offset);
2160
+
for (i=0; i<top&& !mono_class_has_failure (klass); i++) {
mono_class_set_type_load_failure (klass, "Could not load type '%s' because it contains an object field at offset %d that is incorrectly aligned or overlapped by a non-object field.", klass->name, field->offset);
0 commit comments