mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-12 17:24:09 +00:00
FFI: Compile lightuserdata to void * conversion.
This commit is contained in:
parent
c8cfca0557
commit
88c7785b87
@ -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)));
|
sp = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, sizeof(GCstr)));
|
||||||
sid = CTID_A_CCHAR;
|
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;
|
IRType t;
|
||||||
sid = argv2cdata(J, sp, sval)->ctypeid;
|
sid = argv2cdata(J, sp, sval)->ctypeid;
|
||||||
s = ctype_raw(cts, sid);
|
s = ctype_raw(cts, sid);
|
||||||
|
@ -479,6 +479,7 @@ typedef uint32_t TRef;
|
|||||||
#define tref_isnil(tr) (tref_istype((tr), IRT_NIL))
|
#define tref_isnil(tr) (tref_istype((tr), IRT_NIL))
|
||||||
#define tref_isfalse(tr) (tref_istype((tr), IRT_FALSE))
|
#define tref_isfalse(tr) (tref_istype((tr), IRT_FALSE))
|
||||||
#define tref_istrue(tr) (tref_istype((tr), IRT_TRUE))
|
#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_isstr(tr) (tref_istype((tr), IRT_STR))
|
||||||
#define tref_isfunc(tr) (tref_istype((tr), IRT_FUNC))
|
#define tref_isfunc(tr) (tref_istype((tr), IRT_FUNC))
|
||||||
#define tref_iscdata(tr) (tref_istype((tr), IRT_CDATA))
|
#define tref_iscdata(tr) (tref_istype((tr), IRT_CDATA))
|
||||||
|
Loading…
Reference in New Issue
Block a user