aboutsummaryrefslogtreecommitdiff
path: root/src/lj_crecord.c
diff options
context:
space:
mode:
authorMike Pall <mike>2011-04-29 19:40:50 +0200
committerMike Pall <mike>2011-04-29 19:40:50 +0200
commitc77ca54564e63b7ac20a570eee84c57142d6960a (patch)
tree118392f8d4cd6ef783a7dd78f7894b8abe9309f5 /src/lj_crecord.c
parenteb7b452d5393993dc568683b05cbb7b3c4f4f5d0 (diff)
downloadluajit-c77ca54564e63b7ac20a570eee84c57142d6960a.tar.gz
luajit-c77ca54564e63b7ac20a570eee84c57142d6960a.tar.bz2
luajit-c77ca54564e63b7ac20a570eee84c57142d6960a.zip
FFI: Compile C function calls with 64 bit args/results in 32 bit mode.
Diffstat (limited to 'src/lj_crecord.c')
-rw-r--r--src/lj_crecord.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c
index 8330faaf..9c93a6f1 100644
--- a/src/lj_crecord.c
+++ b/src/lj_crecord.c
@@ -785,15 +785,16 @@ static int crec_call(jit_State *J, RecordFFData *rd, GCcdata *cd)
785#if LJ_TARGET_X86 785#if LJ_TARGET_X86
786 ctype_cconv(ct->info) != CTCC_CDECL || 786 ctype_cconv(ct->info) != CTCC_CDECL ||
787#endif 787#endif
788 t == IRT_CDATA || (LJ_32 && (t == IRT_I64 || t == IRT_U64))) 788 t == IRT_CDATA)
789 lj_trace_err(J, LJ_TRERR_NYICALL); 789 lj_trace_err(J, LJ_TRERR_NYICALL);
790 tr = emitir(IRT(IR_CALLXS, t), crec_call_args(J, rd, cts, ct), func); 790 tr = emitir(IRT(IR_CALLXS, t), crec_call_args(J, rd, cts, ct), func);
791 if (t == IRT_FLOAT || t == IRT_U32) { 791 if (t == IRT_FLOAT || t == IRT_U32) {
792 tr = emitconv(tr, IRT_NUM, t, 0); 792 tr = emitconv(tr, IRT_NUM, t, 0);
793 } else if (t == IRT_PTR || (LJ_64 && t == IRT_P32) || 793 } else if (t == IRT_PTR || (LJ_64 && t == IRT_P32) ||
794 (LJ_64 && (t == IRT_I64 || t == IRT_U64))) { 794 (t == IRT_I64 || t == IRT_U64)) {
795 TRef trid = lj_ir_kint(J, ctype_cid(ct->info)); 795 TRef trid = lj_ir_kint(J, ctype_cid(ct->info));
796 tr = emitir(IRTG(IR_CNEWI, IRT_CDATA), trid, tr); 796 tr = emitir(IRTG(IR_CNEWI, IRT_CDATA), trid, tr);
797 if (t == IRT_I64 || t == IRT_U64) lj_needsplit(J);
797 } 798 }
798 J->base[0] = tr; 799 J->base[0] = tr;
799 J->needsnap = 1; 800 J->needsnap = 1;