aboutsummaryrefslogtreecommitdiff
path: root/src/lj_ir.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_ir.c')
-rw-r--r--src/lj_ir.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lj_ir.c b/src/lj_ir.c
index 89be71aa..e2ec22b2 100644
--- a/src/lj_ir.c
+++ b/src/lj_ir.c
@@ -21,6 +21,10 @@
21#include "lj_jit.h" 21#include "lj_jit.h"
22#include "lj_iropt.h" 22#include "lj_iropt.h"
23#include "lj_trace.h" 23#include "lj_trace.h"
24#if LJ_HASFFI
25#include "lj_ctype.h"
26#include "lj_cdata.h"
27#endif
24#include "lj_lib.h" 28#include "lj_lib.h"
25 29
26/* Some local macros to save typing. Undef'd at the end. */ 30/* Some local macros to save typing. Undef'd at the end. */
@@ -380,8 +384,14 @@ void lj_ir_kvalue(lua_State *L, TValue *tv, const IRIns *ir)
380 case IR_KGC: setgcV(L, tv, ir_kgc(ir), irt_toitype(ir->t)); break; 384 case IR_KGC: setgcV(L, tv, ir_kgc(ir), irt_toitype(ir->t)); break;
381 case IR_KPTR: case IR_KNULL: setlightudV(tv, mref(ir->ptr, void)); break; 385 case IR_KPTR: case IR_KNULL: setlightudV(tv, mref(ir->ptr, void)); break;
382 case IR_KNUM: setnumV(tv, ir_knum(ir)->n); break; 386 case IR_KNUM: setnumV(tv, ir_knum(ir)->n); break;
383 /* NYI: use FFI int64_t. */ 387#if LJ_HASFFI
384 case IR_KINT64: setnumV(tv, (lua_Number)(int64_t)ir_kint64(ir)->u64); break; 388 case IR_KINT64: {
389 GCcdata *cd = lj_cdata_new_(L, CTID_INT64, 8);
390 *(uint64_t *)cdataptr(cd) = ir_kint64(ir)->u64;
391 setcdataV(L, tv, cd);
392 break;
393 }
394#endif
385 default: lua_assert(0); break; 395 default: lua_assert(0); break;
386 } 396 }
387} 397}