From 7f24621bec0b0a5b3cab9ec2dfc68929a2d49d25 Mon Sep 17 00:00:00 2001 From: comex Date: Sun, 1 Mar 2015 23:07:15 -0500 Subject: A number of critical fixes painstakingly discovered in the slowest way possible. --- lib/x86/arch-transform-dis.inc.h | 2 +- lib/x86/jump-patch.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/x86') diff --git a/lib/x86/arch-transform-dis.inc.h b/lib/x86/arch-transform-dis.inc.h index a4be424..454423b 100644 --- a/lib/x86/arch-transform-dis.inc.h +++ b/lib/x86/arch-transform-dis.inc.h @@ -89,7 +89,7 @@ static void transform_dis_branch(struct transform_dis_ctx *ctx, uint_tptr dpc, ctx->write_newop_here = code; code += ctx->base.op_size; - uintptr_t source = ctx->pc_trampoline + ctx->base.op_size + 2; + uint_tptr source = ctx->pc_trampoline + ctx->base.op_size + 2; int size = jump_patch_size(source, dpc, arch, true); /* If not taken, jmp past the big jump - this is a bit suboptimal but not diff --git a/lib/x86/jump-patch.h b/lib/x86/jump-patch.h index 09554d1..c09cb1c 100644 --- a/lib/x86/jump-patch.h +++ b/lib/x86/jump-patch.h @@ -1,5 +1,6 @@ #pragma once #define MAX_JUMP_PATCH_SIZE 14 +#define MAX_EXTENDED_PATCH_SIZE (MAX_JUMP_PATCH_SIZE+14) #include "dis.h" static inline int jump_patch_size(uint_tptr pc, uint_tptr dpc, -- cgit v1.2.3