This PR fixes the movable instructions computation in the x86-64 detour backend (and thus potentially fix #47). Currently, only the last instruction in the block is check if movable or not. As a result, any unmovable instructions in the middle of the block (eg: instructions with RIP relative addressing) will be treated as movable and trigger a fault if moved. This PR fixes the movable instructions computation to exclude such instructions. Technically, RIP relative instructions can be moved - the argument needs to be modified to ensure the reference is still valid. However, I felt excluding them is easier to implement and so went down that route. If we want to treat RIP relative instructions as movable, I can look into doing that.
I fixed the x86-64 test cases that failed because of changes in this PR. The sole failing test case fails on master as well and so I think this PR can be merged in.
I fixed the failing test case as well. It seems the test case was incorrectly updated in 29c1c57a and so was failing. Since the change is pretty trivial, I included it in this PR too.
This PR fixes the movable instructions computation in the x86-64 detour backend (and thus potentially fix #47). Currently, only the last instruction in the block is check if movable or not. As a result, any unmovable instructions in the middle of the block (eg: instructions with RIP relative addressing) will be treated as movable and trigger a fault if moved. This PR fixes the movable instructions computation to exclude such instructions. Technically, RIP relative instructions can be moved - the argument needs to be modified to ensure the reference is still valid. However, I felt excluding them is easier to implement and so went down that route. If we want to treat RIP relative instructions as movable, I can look into doing that.