diff options
Diffstat (limited to 'src/lj_asm.c')
-rw-r--r-- | src/lj_asm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c index 9f33cfd9..367fe430 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c | |||
@@ -461,6 +461,14 @@ static void emit_jcc(ASMState *as, int cc, MCode *target) | |||
461 | static void emit_call_(ASMState *as, MCode *target) | 461 | static void emit_call_(ASMState *as, MCode *target) |
462 | { | 462 | { |
463 | MCode *p = as->mcp; | 463 | MCode *p = as->mcp; |
464 | #if LJ_64 | ||
465 | if (target-p != (int32_t)(target-p)) { | ||
466 | /* Assumes RID_RET is never an argument to calls and always clobbered. */ | ||
467 | emit_rr(as, XO_GROUP5, XOg_CALL, RID_RET); | ||
468 | emit_loadu64(as, RID_RET, (uint64_t)target); | ||
469 | return; | ||
470 | } | ||
471 | #endif | ||
464 | *(int32_t *)(p-4) = jmprel(p, target); | 472 | *(int32_t *)(p-4) = jmprel(p, target); |
465 | p[-5] = XI_CALL; | 473 | p[-5] = XI_CALL; |
466 | as->mcp = p - 5; | 474 | as->mcp = p - 5; |