aboutsummaryrefslogtreecommitdiff
path: root/lib/arm64/jump-patch.h
diff options
context:
space:
mode:
authorcomex2015-02-03 02:52:51 -0500
committercomex2015-02-03 02:52:51 -0500
commitc6c8f4abdabd58f9210e5e06c64a6fc36dbc709c (patch)
treebfa2b8577a9e9e5b99c967be0ae1722ce68d6df1 /lib/arm64/jump-patch.h
parentwhoops, don't mean to always jump to thumb mode (diff)
downloadsubstitute-c6c8f4abdabd58f9210e5e06c64a6fc36dbc709c.tar.gz
fix ARM64 too, theoretically
Diffstat (limited to 'lib/arm64/jump-patch.h')
-rw-r--r--lib/arm64/jump-patch.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/arm64/jump-patch.h b/lib/arm64/jump-patch.h
index cc94f90..3d3d653 100644
--- a/lib/arm64/jump-patch.h
+++ b/lib/arm64/jump-patch.h
@@ -14,8 +14,8 @@ static inline int jump_patch_size(uintptr_t pc, uintptr_t dpc,
}
static inline void make_jump_patch(void **codep, uintptr_t pc, uintptr_t dpc,
- UNUSED struct arch_dis_ctx arch) {
- int reg = 15;
+ struct arch_dis_ctx arch) {
+ int reg = arm64_get_unwritten_temp_reg(&arch);
intptr_t diff = (dpc & ~0xfff) - (pc & ~0xfff);
if (!(diff >= -0x100000000 && diff < 0x100000000))
MOVi64(codep, reg, dpc);