diff options
Diffstat (limited to 'src/lj_asm.c')
-rw-r--r-- | src/lj_asm.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c index 2e204239..9fe53416 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c | |||
@@ -888,7 +888,16 @@ static uint32_t asm_callx_flags(ASMState *as, IRIns *ir) | |||
888 | nargs++; | 888 | nargs++; |
889 | while (ira->o == IR_CARG) { nargs++; ira = IR(ira->op1); } | 889 | while (ira->o == IR_CARG) { nargs++; ira = IR(ira->op1); } |
890 | } | 890 | } |
891 | /* NYI: fastcall etc. */ | 891 | #if LJ_HASFFI |
892 | if (IR(ir->op2)->o == IR_CARG) { /* Copy calling convention info. */ | ||
893 | CTypeID id = (CTypeID)IR(IR(ir->op2)->op2)->i; | ||
894 | CType *ct = ctype_get(ctype_ctsG(J2G(as->J)), id); | ||
895 | nargs |= ((ct->info & CTF_VARARG) ? CCI_VARARG : 0); | ||
896 | #if LJ_TARGET_X86 | ||
897 | nargs |= (ctype_cconv(ct->info) << CCI_CC_SHIFT); | ||
898 | #endif | ||
899 | } | ||
900 | #endif | ||
892 | return (nargs | (ir->t.irt << CCI_OTSHIFT)); | 901 | return (nargs | (ir->t.irt << CCI_OTSHIFT)); |
893 | } | 902 | } |
894 | 903 | ||