Hey Jan, On Mon, Apr 26, 2010 at 4:13 PM, Jan <[email protected]> wrote: > if i insert code into an existing function, do i have to care about > the length of existing branches? For example, if I have a br_s in the > code where I insert code between the br_s instruction and the > instruction it jumps to. What happens if the br_s is now too short, > will it be replaced by a br?
Not automatically, so yeah, you have to care. The easiest is to call the extension method Simplify () on a method body before any instrumentation. It will turn every macro opcode into it's full form. (br.s -> br, ldloc.0 -> ldloc v_0, ..). Then when you're done instrumenting, you can simply call the extension method Optimize () on the method body, to do exactly the opposite. Here, fixed :) -- Jb Evain <[email protected]> -- -- mono-cecil Subscription settings: http://groups.google.com/group/mono-cecil/subscribe?hl=en
