Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion sljit_src/sljitNativeX86_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,9 @@ static sljit_u8* detect_near_jump_type(struct sljit_jump *jump, sljit_u8 *code_p
sljit_s32 short_jump;
sljit_uw label_addr;
sljit_uw jump_addr;
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
sljit_uw rel_size;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably you need to add #if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) arond this as well.

#endif /* SLJIT_CONFIG_X86_64 */

jump_addr = (sljit_uw)code_ptr;
if (!(jump->flags & JUMP_ADDR)) {
Expand All @@ -692,7 +695,8 @@ static sljit_u8* detect_near_jump_type(struct sljit_jump *jump, sljit_u8 *code_p
label_addr = jump->u.target - (sljit_uw)executable_offset;

#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
if ((sljit_sw)(label_addr - (jump_addr + 6)) > HALFWORD_MAX || (sljit_sw)(label_addr - (jump_addr + 5)) < HALFWORD_MIN)
rel_size = (type < SLJIT_JUMP) ? 6 : 5;
if ((sljit_sw)(label_addr - (jump_addr + rel_size)) > HALFWORD_MAX || (sljit_sw)(label_addr - (jump_addr + rel_size)) < HALFWORD_MIN)
return detect_far_jump_type(jump, code_ptr);
#endif /* SLJIT_CONFIG_X86_64 */

Expand Down