else if (info->subtype == WRAPPER_SUBTYPE_UNSAFE_ACCESSOR) {
encode_method_ref (acfg, info->d.unsafe_accessor.method, p, &p);
encode_value (info->d.unsafe_accessor.kind, p, &p);
- /* WISH: is there some kind of string heap token we could use here? */
- uint32_t len = (uint32_t) strlen (info->d.unsafe_accessor.member_name);
- encode_value (len, p, &p);
- encode_string (info->d.unsafe_accessor.member_name, p, &p);
+ if (info->d.unsafe_accessor.member_name) {
+ /* WISH: is there some kind of string heap token we could use here? */
+ uint32_t len = (uint32_t) strlen (info->d.unsafe_accessor.member_name);
+ encode_value (len, p, &p);
+ encode_string (info->d.unsafe_accessor.member_name, p, &p);
+ }
}
else if (info->subtype == WRAPPER_SUBTYPE_INTERP_IN)
encode_signature (acfg, info->d.interp_in.sig, p, &p);
generic_context = &generic_container->context;
cfg->generic_context = generic_context;
- if (!cfg->gshared)
- g_assert (!sig->has_type_parameters);
+ if (!cfg->gshared) {
+ gboolean check_type_parameter = TRUE;
+ if (method->wrapper_type == MONO_WRAPPER_OTHER) {
+ WrapperInfo *info = mono_marshal_get_wrapper_info (method);
+ g_assert (info);
+ if (info->subtype == WRAPPER_SUBTYPE_UNSAFE_ACCESSOR)
+ check_type_parameter = FALSE;
+ }
+
+ if (check_type_parameter)
+ g_assert (!sig->has_type_parameters);
+ }
if (sig->generic_param_count && method->wrapper_type == MONO_WRAPPER_NONE) {
g_assert (method->is_inflated);