On Oct 10, 7:29 am, Jb Evain <[email protected]> wrote: > 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]>
It doesn't make sense though to have the TryEnd be an instruction that isn't in the Try. -- -- mono-cecil
