diff --git a/src/cpu/core_dyn_x86/risc_x64.h b/src/cpu/core_dyn_x86/risc_x64.h index f9ae3b75..1bdc257d 100644 --- a/src/cpu/core_dyn_x86/risc_x64.h +++ b/src/cpu/core_dyn_x86/risc_x64.h @@ -1150,8 +1150,9 @@ static Bit8u * gen_create_branch_long(BranchTypes type) { return (cache.pos-4); } -static void gen_fill_branch_long(Bit8u * data,Bit8u * from=cache.pos) { - *(Bit32u*)data=(Bit32u)(from-data-4); +static void gen_fill_branch_long(uint8_t *data, uint8_t *from = cache.pos) +{ + host_writed(data, from - data - sizeof(uint32_t)); } static Bit8u * gen_create_jump(Bit8u * to=0) { diff --git a/src/cpu/core_dyn_x86/risc_x86.h b/src/cpu/core_dyn_x86/risc_x86.h index 1f663c92..713b102e 100644 --- a/src/cpu/core_dyn_x86/risc_x86.h +++ b/src/cpu/core_dyn_x86/risc_x86.h @@ -983,8 +983,8 @@ static Bit8u * gen_create_branch_long(BranchTypes type) { return (cache.pos-4); } -static void gen_fill_branch_long(Bit8u * data,Bit8u * from=cache.pos) { - *(Bit32u*)data=(from-data-4); +static void gen_fill_branch_long(uint8_t *data, uint8_t *from = cache.pos) { + host_writed(data, from - data - sizeof(uint32_t)); } static Bit8u * gen_create_jump(Bit8u * to=0) {