FFI: Compile lightuserdata to void * conversion.

This commit is contained in:
Mike Pall 2013-10-09 17:23:08 +02:00
parent c8cfca0557
commit 88c7785b87
2 changed files with 7 additions and 1 deletions

View File

@ -641,7 +641,12 @@ static TRef crec_ct_tv(jit_State *J, CType *d, TRef dp, TRef sp, cTValue *sval)
sp = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, sizeof(GCstr)));
sid = CTID_A_CCHAR;
}
} else { /* NYI: tref_istab(sp), tref_islightud(sp). */
} else if (tref_islightud(sp)) {
#if LJ_64
sp = emitir(IRT(IR_BAND, IRT_P64), sp,
lj_ir_kint64(J, U64x(00007fff,ffffffff)));
#endif
} else { /* NYI: tref_istab(sp). */
IRType t;
sid = argv2cdata(J, sp, sval)->ctypeid;
s = ctype_raw(cts, sid);

View File

@ -479,6 +479,7 @@ typedef uint32_t TRef;
#define tref_isnil(tr) (tref_istype((tr), IRT_NIL))
#define tref_isfalse(tr) (tref_istype((tr), IRT_FALSE))
#define tref_istrue(tr) (tref_istype((tr), IRT_TRUE))
#define tref_islightud(tr) (tref_istype((tr), IRT_LIGHTUD))
#define tref_isstr(tr) (tref_istype((tr), IRT_STR))
#define tref_isfunc(tr) (tref_istype((tr), IRT_FUNC))
#define tref_iscdata(tr) (tref_istype((tr), IRT_CDATA))