Hy,

While I testing Arrays in Cecil, I came accros a prb in array
dimension signature :


// Code from Mono.Cecil.Signatures.SignatureReader :: ReadType (byte[]
data, int pos, out int start)
...
shape.NumLoBounds = Utilities.ReadCompressedInteger (data, start, out
start);
shape.LoBounds = new int [shape.NumLoBounds];
for (int i = 0; i < shape.NumLoBounds; i++)
        shape.LoBounds [i] = Utilities.ReadCompressedInteger (data, start,
out start);
...


According to Serge Lidin (Expert .Net 2.0 IL Assembler)
"Signed integer values (lower bound values) are compressed according
to a different compression
procedure. First the signed integer is encoded as an unsigned integer
by taking the
absolute value of the original integer, shifting it left by 1 bit, and
setting the least significant bit
according to the most significant (sign) bit of the original value.
Then compression is applied
..."

This causes a problem in all arrays types with a lower bound != 0 !
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---

Reply via email to