- case MONO_TYPE_VAR: {
- MonoGenericContainer *container = mono_type_get_generic_param_owner (type);
- if (container) {
- g_assert (!container->is_method);
- /*
- * FIXME: The following check is here solely
- * for monodis, which uses the internal
- * function
- * mono_metadata_load_generic_params(). The
- * caller of that function needs to fill in
- * owner->klass or owner->method of the
- * returned struct, but monodis doesn't do
- * that. The image unloading depends on that,
- * however, so a crash results without this
- * check.
- */
- if (!container->owner.klass)
- return container->image == image;
- return container->owner.klass->image == image;
- } else {
- return type->data.generic_param->image == image;
- }
- }
- case MONO_TYPE_MVAR: {
- MonoGenericContainer *container = mono_type_get_generic_param_owner (type);
- if (type->data.generic_param->image == image)
- return TRUE;
- if (container) {
- g_assert (container->is_method);
- if (!container->owner.method)
- /* RefEmit created generic param whose method is not finished */
- return container->image == image;
- return container->owner.method->klass->image == image;
- } else {
- return type->data.generic_param->image == image;
- }
- }