diff options
author | Mike Pall <mike> | 2013-10-09 17:23:08 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2013-10-09 17:23:08 +0200 |
commit | 88c7785b8726e7dc9538d0cde680e315b4990b62 (patch) | |
tree | aa65b4a487b68918bc198770f64f1698aef1fd00 | |
parent | c8cfca05578932567d2c65d59262f398e8acaed2 (diff) | |
download | luajit-88c7785b8726e7dc9538d0cde680e315b4990b62.tar.gz luajit-88c7785b8726e7dc9538d0cde680e315b4990b62.tar.bz2 luajit-88c7785b8726e7dc9538d0cde680e315b4990b62.zip |
FFI: Compile lightuserdata to void * conversion.
-rw-r--r-- | src/lj_crecord.c | 7 | ||||
-rw-r--r-- | src/lj_ir.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c index 41d41904..78e999f2 100644 --- a/src/lj_crecord.c +++ b/src/lj_crecord.c | |||
@@ -641,7 +641,12 @@ static TRef crec_ct_tv(jit_State *J, CType *d, TRef dp, TRef sp, cTValue *sval) | |||
641 | sp = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, sizeof(GCstr))); | 641 | sp = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, sizeof(GCstr))); |
642 | sid = CTID_A_CCHAR; | 642 | sid = CTID_A_CCHAR; |
643 | } | 643 | } |
644 | } else { /* NYI: tref_istab(sp), tref_islightud(sp). */ | 644 | } else if (tref_islightud(sp)) { |
645 | #if LJ_64 | ||
646 | sp = emitir(IRT(IR_BAND, IRT_P64), sp, | ||
647 | lj_ir_kint64(J, U64x(00007fff,ffffffff))); | ||
648 | #endif | ||
649 | } else { /* NYI: tref_istab(sp). */ | ||
645 | IRType t; | 650 | IRType t; |
646 | sid = argv2cdata(J, sp, sval)->ctypeid; | 651 | sid = argv2cdata(J, sp, sval)->ctypeid; |
647 | s = ctype_raw(cts, sid); | 652 | s = ctype_raw(cts, sid); |
diff --git a/src/lj_ir.h b/src/lj_ir.h index 30878b91..f50132ea 100644 --- a/src/lj_ir.h +++ b/src/lj_ir.h | |||
@@ -479,6 +479,7 @@ typedef uint32_t TRef; | |||
479 | #define tref_isnil(tr) (tref_istype((tr), IRT_NIL)) | 479 | #define tref_isnil(tr) (tref_istype((tr), IRT_NIL)) |
480 | #define tref_isfalse(tr) (tref_istype((tr), IRT_FALSE)) | 480 | #define tref_isfalse(tr) (tref_istype((tr), IRT_FALSE)) |
481 | #define tref_istrue(tr) (tref_istype((tr), IRT_TRUE)) | 481 | #define tref_istrue(tr) (tref_istype((tr), IRT_TRUE)) |
482 | #define tref_islightud(tr) (tref_istype((tr), IRT_LIGHTUD)) | ||
482 | #define tref_isstr(tr) (tref_istype((tr), IRT_STR)) | 483 | #define tref_isstr(tr) (tref_istype((tr), IRT_STR)) |
483 | #define tref_isfunc(tr) (tref_istype((tr), IRT_FUNC)) | 484 | #define tref_isfunc(tr) (tref_istype((tr), IRT_FUNC)) |
484 | #define tref_iscdata(tr) (tref_istype((tr), IRT_CDATA)) | 485 | #define tref_iscdata(tr) (tref_istype((tr), IRT_CDATA)) |