FFI: Compile conversions from functions to function pointers.

This commit is contained in:
Mike Pall 2013-10-16 19:51:42 +02:00
parent 570615300e
commit a014d5e65d

View File

@ -651,7 +651,13 @@ static TRef crec_ct_tv(jit_State *J, CType *d, TRef dp, TRef sp, cTValue *sval)
sid = argv2cdata(J, sp, sval)->ctypeid;
s = ctype_raw(cts, sid);
svisnz = cdataptr(cdataV(sval));
if (ctype_isfunc(s->info)) {
sid = lj_ctype_intern(cts, CTINFO(CT_PTR, CTALIGN_PTR|sid), CTSIZE_PTR);
s = ctype_get(cts, sid);
t = IRT_PTR;
} else {
t = crec_ct2irt(cts, s);
}
if (ctype_isptr(s->info)) {
sp = emitir(IRT(IR_FLOAD, t), sp, IRFL_CDATA_PTR);
if (ctype_isref(s->info)) {