Hey, On 11/19/08, Knight Commander <[EMAIL PROTECTED]> wrote: > > It seems that when injecting methods in large assemblies, CECIL confuses > labels and some still-unknown things. > > by confuse I mean that somehow label generation mechanism overflows and > results in labels such as (when disasmed) IL_ffffffee or things in this > range.
Well, Cecil simply emits what you ask it to. In this case you're emitting branches using short form opcodes, like br.s instead of br. And as you inject code, the short form can't hold the offset. What you can do, is to call .Simplify () on the method body before injecting code, and then calling .Optimize () afterwards. -- Jb Evain <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ -- mono-cecil -~----------~----~----~----~------~----~------~--~---
