diff options
Diffstat (limited to 'src/lj_asm_arm.h')
-rw-r--r-- | src/lj_asm_arm.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h index 1963f3ba..2d4b8bae 100644 --- a/src/lj_asm_arm.h +++ b/src/lj_asm_arm.h | |||
@@ -331,13 +331,17 @@ static void asm_callx(ASMState *as, IRIns *ir) | |||
331 | { | 331 | { |
332 | IRRef args[CCI_NARGS_MAX]; | 332 | IRRef args[CCI_NARGS_MAX]; |
333 | CCallInfo ci; | 333 | CCallInfo ci; |
334 | IRRef func; | ||
335 | IRIns *irf; | ||
334 | ci.flags = asm_callx_flags(as, ir); | 336 | ci.flags = asm_callx_flags(as, ir); |
335 | asm_collectargs(as, ir, &ci, args); | 337 | asm_collectargs(as, ir, &ci, args); |
336 | asm_setupresult(as, ir, &ci); | 338 | asm_setupresult(as, ir, &ci); |
337 | if (irref_isk(ir->op2)) { /* Call to constant address. */ | 339 | func = ir->op2; irf = IR(func); |
338 | ci.func = (ASMFunction)(void *)(IR(ir->op2)->i); | 340 | if (irf->o == IR_CARG) { func = irf->op1; irf = IR(func); } |
341 | if (irref_isk(func)) { /* Call to constant address. */ | ||
342 | ci.func = (ASMFunction)(void *)(irf->i); | ||
339 | } else { /* Need a non-argument register for indirect calls. */ | 343 | } else { /* Need a non-argument register for indirect calls. */ |
340 | Reg freg = ra_alloc1(as, ir->op2, RSET_RANGE(RID_R4, RID_R12+1)); | 344 | Reg freg = ra_alloc1(as, func, RSET_RANGE(RID_R4, RID_R12+1)); |
341 | emit_m(as, ARMI_BLXr, freg); | 345 | emit_m(as, ARMI_BLXr, freg); |
342 | ci.func = (ASMFunction)(void *)0; | 346 | ci.func = (ASMFunction)(void *)0; |
343 | } | 347 | } |