diff --git a/src/lj_asm.c b/src/lj_asm.c index a1e92003..7542c77c 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c @@ -1198,7 +1198,7 @@ static void asm_collectargs(ASMState *as, IRIns *ir, const CCallInfo *ci, IRRef *args) { uint32_t n = CCI_XNARGS(ci); - lua_assert(n <= CCI_NARGS_MAX); + lua_assert(n <= CCI_NARGS_MAX*2); /* Account for split args. */ if ((ci->flags & CCI_L)) { *args++ = ASMREF_L; n--; } while (n-- > 1) { ir = IR(ir->op1); diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h index 1e024dcd..ddf1480f 100644 --- a/src/lj_asm_arm.h +++ b/src/lj_asm_arm.h @@ -455,7 +455,7 @@ static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci) static void asm_callx(ASMState *as, IRIns *ir) { - IRRef args[CCI_NARGS_MAX]; + IRRef args[CCI_NARGS_MAX*2]; CCallInfo ci; IRRef func; IRIns *irf; @@ -2132,7 +2132,7 @@ static void asm_tail_prep(ASMState *as) /* Ensure there are enough stack slots for call arguments. */ static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci) { - IRRef args[CCI_NARGS_MAX]; + IRRef args[CCI_NARGS_MAX*2]; uint32_t i, nargs = CCI_XNARGS(ci); int nslots = 0, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR, fprodd = 0; asm_collectargs(as, ir, ci, args); diff --git a/src/lj_asm_mips.h b/src/lj_asm_mips.h index 5070a7a2..fe7d55d3 100644 --- a/src/lj_asm_mips.h +++ b/src/lj_asm_mips.h @@ -328,7 +328,7 @@ static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci) static void asm_callx(ASMState *as, IRIns *ir) { - IRRef args[CCI_NARGS_MAX]; + IRRef args[CCI_NARGS_MAX*2]; CCallInfo ci; IRRef func; IRIns *irf; @@ -1725,7 +1725,7 @@ static void asm_tail_prep(ASMState *as) /* Ensure there are enough stack slots for call arguments. */ static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci) { - IRRef args[CCI_NARGS_MAX]; + IRRef args[CCI_NARGS_MAX*2]; uint32_t i, nargs = CCI_XNARGS(ci); int nslots = 4, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR; asm_collectargs(as, ir, ci, args); diff --git a/src/lj_asm_ppc.h b/src/lj_asm_ppc.h index a4a35547..1cac6fa9 100644 --- a/src/lj_asm_ppc.h +++ b/src/lj_asm_ppc.h @@ -331,7 +331,7 @@ static void asm_setupresult(ASMState *as, IRIns *ir, const CCallInfo *ci) static void asm_callx(ASMState *as, IRIns *ir) { - IRRef args[CCI_NARGS_MAX]; + IRRef args[CCI_NARGS_MAX*2]; CCallInfo ci; IRRef func; IRIns *irf; @@ -1916,7 +1916,7 @@ static void asm_tail_prep(ASMState *as) /* Ensure there are enough stack slots for call arguments. */ static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci) { - IRRef args[CCI_NARGS_MAX]; + IRRef args[CCI_NARGS_MAX*2]; uint32_t i, nargs = CCI_XNARGS(ci); int nslots = 2, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR; asm_collectargs(as, ir, ci, args); diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h index 3a029970..25da5246 100644 --- a/src/lj_asm_x86.h +++ b/src/lj_asm_x86.h @@ -600,7 +600,7 @@ static void *asm_callx_func(ASMState *as, IRIns *irf, IRRef func) static void asm_callx(ASMState *as, IRIns *ir) { - IRRef args[CCI_NARGS_MAX]; + IRRef args[CCI_NARGS_MAX*2]; CCallInfo ci; IRRef func; IRIns *irf; @@ -2593,7 +2593,7 @@ static void asm_tail_prep(ASMState *as) /* Ensure there are enough stack slots for call arguments. */ static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci) { - IRRef args[CCI_NARGS_MAX]; + IRRef args[CCI_NARGS_MAX*2]; int nslots; asm_collectargs(as, ir, ci, args); nslots = asm_count_call_slots(as, ci, args);