diff options
author | Mike Pall <mike> | 2011-10-24 16:14:01 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-10-24 16:14:01 +0200 |
commit | 32098921fda08aad6d67efff20d2e1b31b92fa63 (patch) | |
tree | 12807c4d8b37d5d60db02096b483df1b01425ede /src | |
parent | cb1dd159e3b25e23cb8aa2ba9b6da76bb17398ec (diff) | |
download | luajit-32098921fda08aad6d67efff20d2e1b31b92fa63.tar.gz luajit-32098921fda08aad6d67efff20d2e1b31b92fa63.tar.bz2 luajit-32098921fda08aad6d67efff20d2e1b31b92fa63.zip |
Fix handling of alignment arguments (nil) to CALLX.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_asm_arm.h | 2 | ||||
-rw-r--r-- | src/lj_asm_x86.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h index 786dd831..1963f3ba 100644 --- a/src/lj_asm_arm.h +++ b/src/lj_asm_arm.h | |||
@@ -1739,7 +1739,7 @@ static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci) | |||
1739 | int nslots = 0, ngpr = REGARG_NUMGPR; | 1739 | int nslots = 0, ngpr = REGARG_NUMGPR; |
1740 | asm_collectargs(as, ir, ci, args); | 1740 | asm_collectargs(as, ir, ci, args); |
1741 | for (i = 0; i < nargs; i++) | 1741 | for (i = 0; i < nargs; i++) |
1742 | if (!LJ_SOFTFP && irt_isfp(IR(args[i])->t)) { | 1742 | if (!LJ_SOFTFP && args[i] && irt_isnum(IR(args[i])->t)) { |
1743 | ngpr &= ~1; | 1743 | ngpr &= ~1; |
1744 | if (ngpr > 0) ngpr -= 2; else nslots += 2; | 1744 | if (ngpr > 0) ngpr -= 2; else nslots += 2; |
1745 | } else { | 1745 | } else { |
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h index 6767e0c7..2edfe6e6 100644 --- a/src/lj_asm_x86.h +++ b/src/lj_asm_x86.h | |||
@@ -2618,7 +2618,7 @@ static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci) | |||
2618 | uint32_t i; | 2618 | uint32_t i; |
2619 | int ngpr = 6, nfpr = 8; | 2619 | int ngpr = 6, nfpr = 8; |
2620 | for (i = 0; i < nargs; i++) | 2620 | for (i = 0; i < nargs; i++) |
2621 | if (irt_isfp(IR(args[i])->t)) { | 2621 | if (args[i] && irt_isfp(IR(args[i])->t)) { |
2622 | if (nfpr > 0) nfpr--; else nslots += 2; | 2622 | if (nfpr > 0) nfpr--; else nslots += 2; |
2623 | } else { | 2623 | } else { |
2624 | if (ngpr > 0) ngpr--; else nslots += 2; | 2624 | if (ngpr > 0) ngpr--; else nslots += 2; |
@@ -2633,7 +2633,7 @@ static Reg asm_setup_call_slots(ASMState *as, IRIns *ir, const CCallInfo *ci) | |||
2633 | } else { | 2633 | } else { |
2634 | uint32_t i; | 2634 | uint32_t i; |
2635 | for (i = 0; i < nargs; i++) | 2635 | for (i = 0; i < nargs; i++) |
2636 | nslots += irt_isnum(IR(args[i])->t) ? 2 : 1; | 2636 | nslots += (args[i] && irt_isnum(IR(args[i])->t)) ? 2 : 1; |
2637 | if (nslots > as->evenspill) /* Leave room for args. */ | 2637 | if (nslots > as->evenspill) /* Leave room for args. */ |
2638 | as->evenspill = nslots; | 2638 | as->evenspill = nslots; |
2639 | } | 2639 | } |