Discussion:
system.byte variable with a value way too big for a byte
(too old to reply)
JR
2010-11-12 17:46:21 UTC
Permalink
Raw Message
I have noticed this a few times and dont understand it so I thought
I'd ask.
When looking at byte values in windbg with sos.dll or psscor2.dll I
see values in there way above what is allowed.

Fields:
MT Field Offset Type VT
Attr Value Name
79333520 4000216 0 System.Byte 1 instance
4294967267 m_value


I see this a lot, what am I missing? How are numbers like 429496267
stored in system.byte?
rogero
2010-11-16 09:40:47 UTC
Permalink
Raw Message
Post by JR
I have noticed this a few times and dont understand it so I thought
I'd ask.
When looking at byte values in windbg with sos.dll or psscor2.dll I
see values in there way above what is allowed.
          MT    Field               Offset   Type VT
Attr           Value          Name
    79333520  4000216        0          System.Byte  1 instance
4294967267 m_value
I see this a lot, what am I missing? How are numbers like 429496267
stored in system.byte?
Think about twos-completement arithmetic....

4294967267 = 0xFFFFFFE3

So the byte value of 0xE3 is sign extended to the value you see.

Roger.

Loading...