* Copyright 2004-2009 Novell, Inc (http://www.novell.com)
* Copyright 2011 Rodrigo Kumpera
*
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include <config.h>
#include "mono/utils/mono-digest.h"
klass = mono_object_class (arg);
- if (mono_object_isinst_checked (arg, mono_defaults.systemtype_class, &error)) {
+ if (mono_object_isinst_checked (arg, mono_defaults.systemtype_class, error)) {
*p++ = 0x50;
goto handle_type;
} else {
- mono_error_raise_exception (&error); /* FIXME don't raise here */
+ return_if_nok (error);
}
if (klass->enumtype) {
* LOCKING: Take the loader lock
*/
gpointer
-mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context)
+mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context, MonoError *error)
{
- MonoError error;
MonoDynamicImage *assembly = (MonoDynamicImage*)image;
MonoObject *obj;
MonoClass *klass;
+ mono_error_init (error);
+
obj = lookup_dyn_token (assembly, token);
if (!obj) {
if (valid_token)
g_error ("Could not find required dynamic token 0x%08x", token);
- else
+ else {
+ mono_error_set_execution_engine (error, "Could not find dynamic token 0x%08x", token);
return NULL;
+ }
}
if (!handle_class)
handle_class = &klass;
- gpointer result = resolve_object (image, obj, handle_class, context, &error);
- mono_error_raise_exception (&error); /* FIXME don't raise here */
+ gpointer result = resolve_object (image, obj, handle_class, context, error);
return result;
}