]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Handle calls with max. args in backends even after SPLIT.
authorMike Pall <mike>
Thu, 16 May 2013 17:59:38 +0000 (19:59 +0200)
committerMike Pall <mike>
Thu, 16 May 2013 17:59:38 +0000 (19:59 +0200)
src/lj_asm.c
src/lj_asm_arm.h
src/lj_asm_mips.h
src/lj_asm_ppc.h
src/lj_asm_x86.h

index 038f4d1c204eb4c1836d9ed5b809fbea5a155517..316e81d6a857e1b325b18652f61a6427b3e40ab9 100644 (file)
@@ -948,7 +948,7 @@ static void asm_collectargs(ASMState *as, IRIns *ir,
                            const CCallInfo *ci, IRRef *args)
 {
   uint32_t n = CCI_NARGS(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);
index 7c5f7188646823b6e70ad3cbf1109af84f2d36a8..a66573c0a3bc0789a71270d1f3101a3446070c91 100644 (file)
@@ -464,7 +464,7 @@ static void asm_call(ASMState *as, IRIns *ir)
 
 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;
@@ -2295,7 +2295,7 @@ static void asm_ir(ASMState *as, IRIns *ir)
 /* 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 = (int)CCI_NARGS(ci);
   int nslots = 0, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR, fprodd = 0;
   asm_collectargs(as, ir, ci, args);
index 7d1a8c68691f05f9a40bb09c37b841b4a05177b3..9fe7c9c3348a5de3508f6ff5f8055851b6a6fb4f 100644 (file)
@@ -337,7 +337,7 @@ static void asm_call(ASMState *as, IRIns *ir)
 
 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;
@@ -1894,7 +1894,7 @@ static void asm_ir(ASMState *as, IRIns *ir)
 /* 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 = (int)CCI_NARGS(ci);
   int nslots = 4, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR;
   asm_collectargs(as, ir, ci, args);
index 34bd721fb9230fe2c79d54995664acfdb2b87ea0..651fa3187a15368986fbc4869d5e3d3e7c024ed8 100644 (file)
@@ -340,7 +340,7 @@ static void asm_call(ASMState *as, IRIns *ir)
 
 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;
@@ -2092,7 +2092,7 @@ static void asm_ir(ASMState *as, IRIns *ir)
 /* 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 = (int)CCI_NARGS(ci);
   int nslots = 2, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR;
   asm_collectargs(as, ir, ci, args);
index 8bae17899c7d0e6c66528b7205edf8056846ac54..64441ccb7a000b64f69889a4d45112054499c656 100644 (file)
@@ -609,7 +609,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;
@@ -2742,7 +2742,7 @@ static void asm_ir(ASMState *as, IRIns *ir)
 /* 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);