Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
[mono.git] / mono / metadata / verify.c
index 9c66d4b1cbd7cc7198eccf03ef2fe3017c026a75..9b2088bfc91e06b6616f7375bc35281b35410472 100644 (file)
@@ -113,16 +113,16 @@ is_valid_assembly_flags (guint32 flags) {
 }
 
 static int
-is_valid_blob (MonoImage *image, guint32 index, int notnull)
+is_valid_blob (MonoImage *image, guint32 blob_index, int notnull)
 {
        guint32 size;
-       const char *p, *send;
+       const char *p, *blob_end;
        
-       if (index >= image->heap_blob.size)
+       if (blob_index >= image->heap_blob.size)
                return 0;
-       p = mono_metadata_blob_heap (image, index);
-       size = mono_metadata_decode_blob_size (p, &send);
-       if (index + size + (send-p) > image->heap_blob.size)
+       p = mono_metadata_blob_heap (image, blob_index);
+       size = mono_metadata_decode_blob_size (p, &blob_end);
+       if (blob_index + size + (blob_end-p) > image->heap_blob.size)
                return 0;
        if (notnull && !size)
                return 0;
@@ -130,20 +130,20 @@ is_valid_blob (MonoImage *image, guint32 index, int notnull)
 }
 
 static const char*
-is_valid_string (MonoImage *image, guint32 index, int notnull)
+is_valid_string (MonoImage *image, guint32 str_index, int notnull)
 {
-       const char *p, *send, *res;
+       const char *p, *blob_end, *res;
        
-       if (index >= image->heap_strings.size)
+       if (str_index >= image->heap_strings.size)
                return NULL;
-       res = p = mono_metadata_string_heap (image, index);
-       send = mono_metadata_string_heap (image, image->heap_strings.size - 1);
+       res = p = mono_metadata_string_heap (image, str_index);
+       blob_end = mono_metadata_string_heap (image, image->heap_strings.size - 1);
        if (notnull && !*p)
                return 0;
        /* 
         * FIXME: should check it's a valid utf8 string, too.
         */
-       while (p <= send) {
+       while (p <= blob_end) {
                if (!*p)
                        return res;
                ++p;
@@ -1710,6 +1710,8 @@ typebuilder_fields[] = {
 static const FieldDesc 
 modulebuilder_fields[] = {
        {"types", G_STRUCT_OFFSET (MonoReflectionModuleBuilder, types)},
+       {"cattrs", G_STRUCT_OFFSET (MonoReflectionModuleBuilder, cattrs)},
+       {"guid", G_STRUCT_OFFSET (MonoReflectionModuleBuilder, guid)},
        {"table_idx", G_STRUCT_OFFSET (MonoReflectionModuleBuilder, table_idx)},
        {NULL, 0}
 };