]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix handling of alignment arguments (nil) to CALLX.
authorMike Pall <mike>
Mon, 24 Oct 2011 14:14:01 +0000 (16:14 +0200)
committerMike Pall <mike>
Mon, 24 Oct 2011 14:14:01 +0000 (16:14 +0200)
src/lj_asm_arm.h
src/lj_asm_x86.h

index 786dd8311ab062e894109638d1927cdb70737c60..1963f3bae1fa7fcb10603f240d2f5e19da0a10f9 100644 (file)
@@ -1739,7 +1739,7 @@ static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci)
   int nslots = 0, ngpr = REGARG_NUMGPR;
   asm_collectargs(as, ir, ci, args);
   for (i = 0; i < nargs; i++)
-    if (!LJ_SOFTFP && irt_isfp(IR(args[i])->t)) {
+    if (!LJ_SOFTFP && args[i] && irt_isnum(IR(args[i])->t)) {
       ngpr &= ~1;
       if (ngpr > 0) ngpr -= 2; else nslots += 2;
     } else {
index 6767e0c7a2c420b8fe59d9997c286704b40a8025..2edfe6e6f93eec3afdeba567f7083ed421c6fdaa 100644 (file)
@@ -2618,7 +2618,7 @@ static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci)
     uint32_t i;
     int ngpr = 6, nfpr = 8;
     for (i = 0; i < nargs; i++)
-      if (irt_isfp(IR(args[i])->t)) {
+      if (args[i] && irt_isfp(IR(args[i])->t)) {
        if (nfpr > 0) nfpr--; else nslots += 2;
       } else {
        if (ngpr > 0) ngpr--; else nslots += 2;
@@ -2633,7 +2633,7 @@ static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci)
   } else {
     uint32_t i;
     for (i = 0; i < nargs; i++)
-      nslots += irt_isnum(IR(args[i])->t) ? 2 : 1;
+      nslots += (args[i] && irt_isnum(IR(args[i])->t)) ? 2 : 1;
     if (nslots > as->evenspill)  /* Leave room for args. */
       as->evenspill = nslots;
   }