On Sun, Oct 10, 2010 at 1:23 PM, High6 <[email protected]> wrote:
> This has bothered me ever since I started using mono.

You must be confused, this has nothing to do with Mono.

> In CodeReader
> handler.TryEnd = GetInstruction (handler.TryStart.Offset + read_length
> ());
> Should be in a sense
> handler.TryEnd = GetInstruction (handler.TryStart.Offset + read_length
> ()).Previous;
>
> It bugs me so much. Why is TryEnd the next instruction? It makes it
> such a pain when dealing with Handlers because of this. TryEnd should
> be the actual instruction it ends on. Not the next one.

No it should not. Cecil maps how the metadata is constructed, and not
how you would like it to be constructed. If you want the last
instruction of the exception handler, just get its previous
instruction. Hell, you can even write an extension method for it.

-- 
Jb EvainĀ  <[email protected]>

-- 
--
mono-cecil

Reply via email to