In mini/
authorZoltan Varga <vargaz@gmail.com>
Sat, 28 Mar 2009 19:55:47 +0000 (19:55 -0000)
committerZoltan Varga <vargaz@gmail.com>
Sat, 28 Mar 2009 19:55:47 +0000 (19:55 -0000)
* mini.c (mini_method_compile): Clear the loader error if the method
header cannot be decoded.

In tests/

* load-exceptions.cs: Add a test for missing locals.

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

mono/mini/ChangeLog
mono/mini/mini.c
mono/tests/ChangeLog
mono/tests/load-exceptions.cs

index 2519244aa7b72a22ca6696a8bc071754e9ddb1d0..d31843de9e0f26afa939e1edd66bb632b4ea00b7 100644 (file)
@@ -1,5 +1,8 @@
 2009-03-28  Zoltan Varga  <vargaz@gmail.com>
 
+       * mini.c (mini_method_compile): Clear the loader error if the method
+       header cannot be decoded.
+
        * mini-trampolines.c (mono_magic_trampoline): Handle generic virtual 
        interface methods on proxies correctly.
 
index 2979e514a9e6828bbb085a220f5b09c22380a3c8..dd645416a6cf109c6c1da92cf37bd6c8c3acdcb5 100644 (file)
@@ -3165,6 +3165,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
 
        header = mono_method_get_header (method_to_compile);
        if (!header) {
+               mono_loader_clear_error ();
                cfg->exception_type = MONO_EXCEPTION_INVALID_PROGRAM;
                cfg->exception_message = g_strdup_printf ("Missing or incorrect header for method %s", cfg->method->name);
                if (MONO_PROBE_METHOD_COMPILE_END_ENABLED ())
index bc2a4243b519563da5757d583f060320d07661e1..00e4c9fe522aa68782bab98a005430c5d64cd0e5 100644 (file)
@@ -1,5 +1,7 @@
 2009-03-28  Zoltan Varga  <vargaz@gmail.com>
 
+       * load-exceptions.cs: Add a test for missing locals.
+
        * remoting4.cs: Add a test for generic virtual interface methods on proxies.
 
 2009-03-28  Sebastien Pouliot  <sebastien@ximian.com>
index 78c48548a9f50f36b5eb04167ab137b3ca02c989..b52109bea97de61fc82c0df3f8c01532ec918c8a 100644 (file)
@@ -225,19 +225,21 @@ public class Tests : LoadMissing {
        // Missing classes referenced from metadata
        //
 
-       // FIXME: These do not work yet
-#if FALSE
        public static int test_0_missing_local () {
                try {
                        missing_local ();
                }
                catch (TypeLoadException ex) {
                }
+               catch (InvalidProgramException ex) {
+               }
 
                /* MS.NET doesn't throw an exception if a local is not found */
                return 0;
        }
 
+       // FIXME: These do not work yet
+#if FALSE
        public static void missing_parent () {
                new Miss1 ();
        }