brtrue.s points to an invalid address after inserting #112
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If there is a while loop in the code which is extended by Cecil, the brtrue.s instruction of the loop will point to an address which is not an instruction in the code.
For more details I uploaded to screenshots from the .NET Reflector to illustrate the problem.
My original code (before the insert) is here:
http://www.naplampa.hu/MonoCecil_OffsetBug_Original.png
My patched code (after the insert) is here:
http://www.naplampa.hu/MonoCecil_OffsetBug_Patched.png
Cecil itself won't check the validity of your code. See https://github.com/jbevain/cecil/issues/44 or http://stackoverflow.com/questions/7267480/does-mono-cecil-take-care-of-branches-etc-location