* verify.c (verify_class_for_overlapping_reference_fields):
If class is under fulltrust allow reference types to overllap
if they have the same RVA.
svn path=/trunk/mono/; revision=101722
+2008-04-24 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * verify.c (verify_class_for_overlapping_reference_fields):
+ If class is under fulltrust allow reference types to overllap
+ if they have the same RVA.
+
2008-04-24 Rodrigo Kumpera <rkumpera@novell.com>
* pedump.c: Added new flag valid-only, that makes the verifier
verify_class_for_overlapping_reference_fields (MonoClass *class)
{
int i, j, align;
+ gboolean is_fulltrust = mono_verifier_is_class_full_trust (class);
if (!(class->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT || !class->has_references)
return TRUE;
int otherEnd = other->offset + mono_type_size (other->type, &align);
if (mono_field_is_deleted (other) || (is_valuetype && !MONO_TYPE_IS_REFERENCE (other->type)) || (other->type->attrs & FIELD_ATTRIBUTE_STATIC))
continue;
+
+ if (!is_valuetype && MONO_TYPE_IS_REFERENCE (other->type) && field->offset == other->offset && is_fulltrust)
+ continue;
+
if ((otherEnd > field->offset && otherEnd <= fieldEnd) || (other->offset >= field->offset && other->offset < fieldEnd))
return FALSE;
}