X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Freflection.c;h=c49153f85a1615f3052355b6c3fc37086d85f0a2;hb=3e69ff3ae72acec33c471236da49ed6c78b26dc4;hp=b40ce1bf90ecc9853074ad36b3778b99217dda83;hpb=1c6b82896fd4f2079e76af7acd784d516189b05c;p=mono.git diff --git a/mono/metadata/reflection.c b/mono/metadata/reflection.c index b40ce1bf90e..c49153f85a1 100644 --- a/mono/metadata/reflection.c +++ b/mono/metadata/reflection.c @@ -13695,25 +13695,27 @@ mono_reflection_lookup_signature (MonoImage *image, MonoMethod *method, guint32 * 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; }