Skip to content
Browse files

2006-10-06 Zoltan Varga <vargaz@gmail.com>

	* class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
	PropertyPtr table.

svn path=/trunk/mono/; revision=66343
  • Loading branch information...
1 parent fc6dcdc commit d85e67cc2f877735a9f130981fd30ae4cc725ad2 @vargaz vargaz committed Oct 6, 2006
Showing with 26 additions and 5 deletions.
  1. +5 −0 mono/metadata/ChangeLog
  2. +1 −1 mono/metadata/blob.h
  3. +1 −2 mono/metadata/class.c
  4. +14 −2 mono/metadata/metadata.c
  5. +5 −0 mono/metadata/row-indexes.h
View
5 mono/metadata/ChangeLog
@@ -1,3 +1,8 @@
+2006-10-06 Zoltan Varga <vargaz@gmail.com>
+
+ * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
+ PropertyPtr table.
+
2006-10-05 Zoltan Varga <vargaz@gmail.com>
* loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
View
2 mono/metadata/blob.h
@@ -70,7 +70,7 @@ typedef enum {
MONO_TABLE_EVENT_POINTER,
MONO_TABLE_EVENT,
MONO_TABLE_PROPERTYMAP,
- MONO_TABLE_UNUSED5,
+ MONO_TABLE_PROPERTY_POINTER,
MONO_TABLE_PROPERTY,
MONO_TABLE_METHODSEMANTICS,
MONO_TABLE_METHODIMPL,
View
3 mono/metadata/class.c
@@ -1289,7 +1289,6 @@ mono_class_setup_properties (MonoClass *class)
{
guint startm, endm, i, j;
guint32 cols [MONO_PROPERTY_SIZE];
- MonoTableInfo *pt = &class->image->tables [MONO_TABLE_PROPERTY];
MonoTableInfo *msemt = &class->image->tables [MONO_TABLE_METHODSEMANTICS];
MonoProperty *properties;
guint32 last;
@@ -1312,7 +1311,7 @@ mono_class_setup_properties (MonoClass *class)
properties = mono_mempool_alloc0 (class->image->mempool, sizeof (MonoProperty) * class->property.count);
for (i = class->property.first; i < last; ++i) {
- mono_metadata_decode_row (pt, i, cols, MONO_PROPERTY_SIZE);
+ mono_metadata_decode_table_row (class->image, MONO_TABLE_PROPERTY, i, cols, MONO_PROPERTY_SIZE);
properties [i - class->property.first].parent = class;
properties [i - class->property.first].attrs = cols [MONO_PROPERTY_FLAGS];
properties [i - class->property.first].name = mono_metadata_string_heap (class->image, cols [MONO_PROPERTY_NAME]);
View
16 mono/metadata/metadata.c
@@ -301,7 +301,11 @@ const static unsigned char TableSchemas [] = {
MONO_MT_BLOB_IDX, /* "Type" }, */
MONO_MT_END,
-#define PROPERTY_MAP_SCHEMA_OFFSET PROPERTY_SCHEMA_OFFSET + 4
+#define PROPERTY_POINTER_SCHEMA_OFFSET PROPERTY_SCHEMA_OFFSET + 4
+ MONO_MT_TABLE_IDX, /* "Property" }, */
+ MONO_MT_END,
+
+#define PROPERTY_MAP_SCHEMA_OFFSET PROPERTY_POINTER_SCHEMA_OFFSET + 2
MONO_MT_TABLE_IDX, /* "Parent:TypeDef" }, */
MONO_MT_TABLE_IDX, /* "PropertyList:Property" }, */
MONO_MT_END,
@@ -375,7 +379,7 @@ table_description [] = {
EVENT_POINTER_SCHEMA_OFFSET,
EVENT_SCHEMA_OFFSET,
PROPERTY_MAP_SCHEMA_OFFSET,
- NULL_SCHEMA_OFFSET,
+ PROPERTY_POINTER_SCHEMA_OFFSET,
PROPERTY_SCHEMA_OFFSET,
METHOD_SEMA_SCHEMA_OFFSET,
METHOD_IMPL_SCHEMA_OFFSET,
@@ -573,6 +577,9 @@ mono_metadata_compute_size (MonoImage *meta, int tableindex, guint32 *result_bit
field_size = i ? idx_size (MONO_TABLE_PROPERTY):
idx_size(MONO_TABLE_TYPEDEF);
break;
+ case MONO_TABLE_PROPERTY_POINTER:
+ g_assert (i == 0);
+ field_size = idx_size (MONO_TABLE_PROPERTY); break;
case MONO_TABLE_TYPEDEF:
g_assert (i == 4 || i == 5);
field_size = i == 4 ? idx_size (MONO_TABLE_FIELD):
@@ -1126,6 +1133,11 @@ mono_metadata_translate_token_index (MonoImage *image, int table, guint32 idx)
return mono_metadata_decode_row_col (&image->tables [MONO_TABLE_EVENT_POINTER], idx - 1, MONO_EVENT_POINTER_EVENT);
else
return idx;
+ case MONO_TABLE_PROPERTY:
+ if (image->tables [MONO_TABLE_PROPERTY_POINTER].rows)
+ return mono_metadata_decode_row_col (&image->tables [MONO_TABLE_PROPERTY_POINTER], idx - 1, MONO_PROPERTY_POINTER_PROPERTY);
+ else
+ return idx;
case MONO_TABLE_PARAM:
if (image->tables [MONO_TABLE_PARAM_POINTER].rows)
return mono_metadata_decode_row_col (&image->tables [MONO_TABLE_PARAM_POINTER], idx - 1, MONO_PARAM_POINTER_PARAM);
View
5 mono/metadata/row-indexes.h
@@ -250,6 +250,11 @@ enum {
};
enum {
+ MONO_PROPERTY_POINTER_PROPERTY,
+ MONO_PROPERTY_POINTER_SIZE
+};
+
+enum {
MONO_PROPERTY_MAP_PARENT,
MONO_PROPERTY_MAP_PROPERTY_LIST,
MONO_PROPERTY_MAP_SIZE

0 comments on commit d85e67c

Please sign in to comment.
Something went wrong with that request. Please try again.