[MetadataReader] document format and constrains of -Ptr tables #14721
Open
Description
opened on Jun 15, 2015
InitializeTableReaders method contains the following code:
// Compute ref sizes for tables that can have pointer tables
int fieldRefSizeSorted = GetReferenceSize(rowCounts, TableIndex.FieldPtr) > SmallIndexSize ? LargeIndexSize : GetReferenceSize(rowCounts, TableIndex.Field);
int methodRefSizeSorted = GetReferenceSize(rowCounts, TableIndex.MethodPtr) > SmallIndexSize ? LargeIndexSize : GetReferenceSize(rowCounts, TableIndex.MethodDef);
int paramRefSizeSorted = GetReferenceSize(rowCounts, TableIndex.ParamPtr) > SmallIndexSize ? LargeIndexSize : GetReferenceSize(rowCounts, TableIndex.Param);
int eventRefSizeSorted = GetReferenceSize(rowCounts, TableIndex.EventPtr) > SmallIndexSize ? LargeIndexSize : GetReferenceSize(rowCounts, TableIndex.Event);
int propertyRefSizeSorted = GetReferenceSize(rowCounts, TableIndex.PropertyPtr) > SmallIndexSize ? LargeIndexSize : GetReferenceSize(rowCounts, TableIndex.Property);
It's not clear if any of these conditions are ever true. I'd think that the size of XxxPtr table is always the same as the corresponding Xxx table, since the Ptr table is used as an index. It might make sense that XxxPtr table is smaller than the Xxx table. But I don't see how it can have more rows.
Do we have tests that cover these?
Activity