On Mon, May 2, 2011 at 12:54 PM, Philip Laureano
<[email protected]> wrote:
> Whenever I try copying branching or conditional instructions (such as
> OpCodes.Br and OpCodes.Brfalse) from an existing method body to a new method
> body, I noticed that Cecil doesn't update the offsets even after I have
> added additional instructions to the new method body. For example, the
> original method body had one brtrue.s instruction that jumped to offset
> IL_0003C, and when I checked the instruction of the new method body, the
> same branching instruction was pointing to the same branching location even
> though the instruction that it was pointing to was no longer at IL_0003C. Is
> there any way that Cecil can help me here, or will I have to manually update
> these branch targets myself? Thanks for the help, btw.

If you insert instruction between a branch and its target, as target
as modeled using Instructions, there should be no issue. So it seems
an issue on your side.

If you provide a small .sln/.csproj reproducing the issue you're
seeing, I can have a look.

Jb

-- 
--
mono-cecil

Reply via email to