2007-01-15 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Mon, 15 Jan 2007 17:56:55 +0000 (17:56 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Mon, 15 Jan 2007 17:56:55 +0000 (17:56 -0000)
* loader.c (mono_loader_error_prepare_exception): Clear the error
once we have extracted the information from it, do this before we
call into the JIT's class loading mechanisms.

* object.c (mono_class_create_runtime_vtable): Do not clear the
loader error before calling mono_class_get_exception_for_failure
as the loader error is needed inside
mono_class_get_exception_for_failure to throw the error (thinko).

Fixes #80521

svn path=/trunk/mono/; revision=71064

mono/metadata/ChangeLog
mono/metadata/loader.c
mono/metadata/object.c

index 153d3f61eeaf885ef665427be373fa0bb5ff8543..4e9669ebd85a8b3e92ec4ebfd4b2b96166cb32f0 100644 (file)
@@ -1,4 +1,16 @@
+2007-01-15  Miguel de Icaza  <miguel@novell.com>
 
+       * loader.c (mono_loader_error_prepare_exception): Clear the error
+       once we have extracted the information from it, do this before we
+       call into the JIT's class loading mechanisms.
+
+       * object.c (mono_class_create_runtime_vtable): Do not clear the
+       loader error before calling mono_class_get_exception_for_failure
+       as the loader error is needed inside
+       mono_class_get_exception_for_failure to throw the error (thinko).
+
+       Fixes #80521
+       
 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
 
        * reflection.c: align fields rva data so it's faster to load at
index 2179a670577621e15e2133b32eb242e058d39c6d..4503f55834dd0693b4bb3ff77f275cb78d0ae27b 100644 (file)
@@ -286,8 +286,8 @@ mono_loader_error_prepare_exception (MonoLoaderError *error)
                else
                        msg = g_strdup_printf ("Could not load file or assembly '%s' or one of its dependencies.", error->assembly_name);
 
-               ex = mono_get_exception_file_not_found2 (msg, mono_string_new (mono_domain_get (), error->assembly_name));
                mono_loader_clear_error ();
+               ex = mono_get_exception_file_not_found2 (msg, mono_string_new (mono_domain_get (), error->assembly_name));
                g_free (msg);
                break;
        }
index e1d7477dd8c484f466e4531591beefc548aaec6b..ff816e13580ac493e1255c02a336d0c9252685cf 100644 (file)
@@ -952,7 +952,6 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class)
                if (!mono_class_init (class) || class->exception_type){
                        MonoException *exc;
                        mono_domain_unlock (domain);
-                       mono_loader_clear_error ();
                        exc = mono_class_get_exception_for_failure (class);
                        g_assert (exc);
                        mono_raise_exception (exc);
@@ -1742,7 +1741,8 @@ handle_enum:
  * @value: The value to be set
  *
  * Sets the value of the field described by @field in the object instance @obj
- * to the value passed in @value.
+ * to the value passed in @value.   This method should only be used for instance
+ * fields.   For static fields, use mono_field_static_set_value.
  *
  * The value must be on the native format of the field type. 
  */