guint32 cols [MONO_METHOD_SIZE];
MonoMethod *method;
const char *m_name;
+ MonoMethodSignature *other_sig;
mono_metadata_decode_table_row (klass->image, MONO_TABLE_METHOD, klass->method.first + i, cols, MONO_METHOD_SIZE);
continue;
method = mono_get_method (klass->image, MONO_TOKEN_METHOD_DEF | (klass->method.first + i + 1), klass);
- if (method && (sig->call_convention != MONO_CALL_VARARG) && mono_metadata_signature_equal (sig, mono_method_signature (method)))
+ other_sig = mono_method_signature (method);
+ if (method && other_sig && (sig->call_convention != MONO_CALL_VARARG) && mono_metadata_signature_equal (sig, other_sig))
return method;
}
}
if (!klass) { /*FIXME put this before the image alloc*/
guint32 type = mono_metadata_typedef_from_method (image, token);
+ if (!type)
+ return NULL;
klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF | type);
if (klass == NULL)
return NULL;
if (signature->generic_param_count) {
if (!container || !container->is_method) {
g_warning ("Signature claims method has generic parameters, but generic_params table says it doesn't for method 0x%08x from image %s", idx, img->name);
+ mono_loader_unlock ();
return NULL;
}
if (container->type_argc != signature->generic_param_count) {
- g_warning ("Inconsistent generic parameter count. Signature says %d, generic_params table says %dfor method 0x%08x from image %s",
+ g_warning ("Inconsistent generic parameter count. Signature says %d, generic_params table says %d for method 0x%08x from image %s",
signature->generic_param_count, container->type_argc, idx, img->name);
+ mono_loader_unlock ();
return NULL;
}
} else if (container && container->is_method && container->type_argc) {
g_warning ("generic_params table claims method has generic parameters, but signature says it doesn't for method 0x%08x from image %s", idx, img->name);
+ mono_loader_unlock ();
return NULL;
}
if (m->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)
case PINVOKE_ATTRIBUTE_CALL_CONV_GENERICINST:
default:
g_warning ("unsupported calling convention : 0x%04x for method 0x%08x from image %s", piinfo->piflags, idx, img->name);
+ mono_loader_unlock ();
return NULL;
}
signature->call_convention = conv;
idx = mono_metadata_token_index (method->token);
img = method->klass->image;
rva = mono_metadata_decode_row_col (&img->tables [MONO_TABLE_METHOD], idx - 1, MONO_METHOD_RVA);
- loc = mono_image_rva_map (img, rva);
-
- g_assert (loc);
if (!mono_verifier_verify_method_header (img, rva, NULL))
return NULL;
+ loc = mono_image_rva_map (img, rva);
+ g_assert (loc);
+
header = mono_metadata_parse_mh_full (img, mono_method_get_generic_container (method), loc);
mono_loader_lock ();