IL short-form instructions aren't short?

Posted by Alix on Stack Overflow See other posts from Stack Overflow or by Alix
Published on 2010-05-21T12:17:15Z Indexed on 2010/05/21 12:20 UTC
Read the original article Hit count: 535

Filed under:
|
|
|
|

Hi. I was looking at the IL code of a valid method with Reflector and I've run into this:

L_00a5: leave.s L_0103

Instructions with the suffix .s are supposed to take an int8 operand, and sure enough this is should be the case with Leave_S as well. However, 0x0103 is 259, which exceeds the capacity of an int8. The method somehow works, but when I read the instructions with method Mono.Reflection.Disassembler.GetInstructions it retrieves

L_00a5: leave.s L_0003

that is, 3 instead of 259, because it's supposed to be an int8. So, my question: how is the original instruction (leave.s L_0103) possible? I have looked at the ECMA documentation for that (Partition III: CIL Instruction Set) and I can't find anything that explains it.

Any ideas? Thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about il