1

Closed

Wrong reading meta token code

description

NetPE.Core.Metadata.Tables.CodedIndexDef.ReadToken (row #294):
 
// Wrong
/*
if (maxLen > ushort.MaxValue)
tkn = rdr.ReadUInt32();
else
tkn = rdr.ReadUInt16();
*/
 
// Right:
 
var is2BytesSize = maxLen < (1 << (16 - bit));
if (is2BytesSize)
            tkn = rdr.ReadUInt16();
        else
            tkn = rdr.ReadUInt32();
Closed Jul 4, 2011 at 12:49 PM by yck1509

comments

wrote Jul 4, 2011 at 12:49 PM

Resolved with changeset 60231.

zuken21 wrote Jul 6, 2011 at 5:34 AM

Reupdated in changeset 60288

if (is2BytesSize)
tkn = rdr.ReadUInt16();
else
tkn = rdr.ReadUInt32();