if (mono_class_has_variant_generic_params (target)) {
if (MONO_CLASS_IS_INTERFACE (target)) {
+ if (MONO_CLASS_IS_INTERFACE (candidate) && mono_class_is_variant_compatible (target, candidate, TRUE))
+ return TRUE;
+
if (candidate->rank == 1) {
if (verifier_inflate_and_check_compat (target, mono_defaults.generic_ilist_class, candidate->element_class))
return TRUE;
merge_stacks (VerifyContext *ctx, ILCodeDesc *from, ILCodeDesc *to, gboolean start, gboolean external)
{
MonoError error;
- int i, j, k;
+ int i, j;
stack_init (ctx, to);
if (start) {
continue;
}
+ /*Both slots are the same boxed valuetype. Simply copy it.*/
+ if (stack_slot_is_boxed_value (old_slot) &&
+ stack_slot_is_boxed_value (new_slot) &&
+ mono_metadata_type_equal (old_type, new_type)) {
+ copy_stack_value (new_slot, old_slot);
+ continue;
+ }
+
if (mono_type_is_generic_argument (old_type) || mono_type_is_generic_argument (new_type)) {
char *old_name = stack_slot_full_name (old_slot);
char *new_name = stack_slot_full_name (new_slot);
goto end_verify;
}
- for (j = 0; j < old_class->interface_count; ++j) {
- for (k = 0; k < new_class->interface_count; ++k) {
- if (mono_metadata_type_equal (&old_class->interfaces [j]->byval_arg, &new_class->interfaces [k]->byval_arg)) {
- match_class = old_class->interfaces [j];
- goto match_found;
- }
- }
- }
-
/* if old class is an interface that new class implements */
if (old_class->flags & TYPE_ATTRIBUTE_INTERFACE) {
if (verifier_class_is_assignable_from (old_class, new_class)) {
mono_verifier_is_class_full_trust (MonoClass *klass)
{
/* under CoreCLR code is trusted if it is part of the "platform" otherwise all code inside the GAC is trusted */
- gboolean trusted_location = (mono_security_get_mode () != MONO_SECURITY_MODE_CORE_CLR) ?
+ gboolean trusted_location = !mono_security_core_clr_enabled () ?
(klass->image->assembly && klass->image->assembly->in_gac) : mono_security_core_clr_is_platform_image (klass->image);
if (verify_all && verifier_mode == MONO_VERIFIER_MODE_OFF)
MonoClass *ctr = *constraints;
MonoType *constraint_type = &ctr->byval_arg;
+ if (!mono_class_can_access_class (class, ctr))
+ goto fail;
+
if (!mono_type_is_valid_type_in_context (constraint_type, &gc->context))
goto fail;