2009-07-07 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Tue, 7 Jul 2009 16:32:35 +0000 (16:32 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Tue, 7 Jul 2009 16:32:35 +0000 (16:32 -0000)
* metadata-verify.c (is_valid_method_header): Parse EH block
flags correctly.

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

mono/metadata/ChangeLog
mono/metadata/metadata-verify.c

index f40e9810a673297c96a0533246d964004943190a..c650780970ca979ac4c9f873a912477a6bfbe012 100644 (file)
@@ -1,3 +1,8 @@
+2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * metadata-verify.c (is_valid_method_header): Parse EH block
+       flags correctly.
+
 2009-07-03  Mark Probst  <mark.probst@gmail.com>
 
        * sgen-gc.c (finish_gray_stack): Set the to_space pointer after
index 34e21e97ea13845dea8823d48381e2003cf1b3e3..5b5fd81303a2bd36f9420a7a299ab61e291b7e15 100644 (file)
@@ -1896,11 +1896,12 @@ is_valid_method_header (VerifyContext *ctx, guint32 rva)
 
                        /* only verify the class token is verified as the rest is done by the IL verifier*/
                        for (i = 0; i < clauses; ++i) {
+                               guint flags = *ptr;
                                guint32 class_token = 0;
                                ptr += (is_fat ? 20 : 8);
                                if (!safe_read32 (class_token, ptr, end))
                                        FAIL (ctx, g_strdup_printf ("MethodHeader: Not enough room for section %d", i));
-                               if (!*ptr == MONO_EXCEPTION_CLAUSE_NONE && class_token) {
+                               if (flags == MONO_EXCEPTION_CLAUSE_NONE && class_token) {
                                        guint table = mono_metadata_token_table (class_token);
                                        if (table != MONO_TABLE_TYPEREF && table != MONO_TABLE_TYPEDEF && table != MONO_TABLE_TYPESPEC)
                                                FAIL (ctx, g_strdup_printf ("MethodHeader: Invalid section %d class token table %x", i, table));