*
* Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
* Copyright 2004-2009 Novell, Inc (http://www.novell.com)
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include <config.h>
guint32 sig;
const char *ptr;
- if (image_is_dynamic (image))
- return (MonoMethodSignature *)mono_lookup_dynamic_token (image, token, NULL);
+ if (image_is_dynamic (image)) {
+ ret = (MonoMethodSignature *)mono_lookup_dynamic_token (image, token, NULL, &error);
+ mono_error_raise_exception (&error); /* FIXME don't raise here */
+ return ret;
+ }
g_assert (mono_metadata_token_table(token) == MONO_TABLE_STANDALONESIG);
for (i = 0; i < method->param_count; ++i) {
if (*ptr == MONO_TYPE_SENTINEL) {
if (method->call_convention != MONO_CALL_VARARG || def) {
- mono_loader_assert_no_error ();
mono_error_set_bad_image (error, m, "Found sentinel for methoddef or no vararg");
g_free (pattrs);
return NULL;
}
if (method->sentinelpos >= 0) {
- mono_loader_assert_no_error ();
mono_error_set_bad_image (error, m, "Found sentinel twice in the same signature.");
g_free (pattrs);
return NULL;
* Add signature to a cache and increase ref count...
*/
- mono_loader_assert_no_error ();
return method;
}
static void
free_inflated_method (MonoMethodInflated *imethod)
{
- int i;
MonoMethod *method = (MonoMethod*)imethod;
if (method->signature)
mono_metadata_free_inflated_signature (method->signature);
- if (!((method->flags & METHOD_ATTRIBUTE_ABSTRACT) || (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) || (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL))) {
- MonoMethodHeader *header = imethod->header;
-
- if (header) {
- /* Allocated in inflate_generic_header () */
- for (i = 0; i < header->num_locals; ++i)
- mono_metadata_free_type (header->locals [i]);
- g_free (header->clauses);
- g_free (header);
- }
- }
-
g_free (method);
}
return FALSE;
type->data.klass = mono_class_from_mono_type (etype);
+
+ if (transient)
+ mono_metadata_free_type (etype);
+
g_assert (type->data.klass); //This was previously a check for NULL, but mcfmt should never fail. It can return a borken MonoClass, but should return at least something.
break;
}
return TRUE;
for (i = 0; i < container->type_argc; i++) {
if (!get_constraints (image, start_row + i, &mono_generic_container_get_param_info (container, i)->constraints, container, error)) {
- mono_loader_assert_no_error ();
return FALSE;
}
}