diff options
Diffstat (limited to 'src/lj_crecord.c')
-rw-r--r-- | src/lj_crecord.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c index a543ffd1..314e0de7 100644 --- a/src/lj_crecord.c +++ b/src/lj_crecord.c | |||
@@ -238,6 +238,7 @@ static void crec_ct_ct(jit_State *J, CType *d, CType *s, TRef dp, TRef sp) | |||
238 | 238 | ||
239 | static TRef crec_tv_ct(jit_State *J, CType *s, CTypeID sid, TRef sp) | 239 | static TRef crec_tv_ct(jit_State *J, CType *s, CTypeID sid, TRef sp) |
240 | { | 240 | { |
241 | CTState *cts = ctype_ctsG(J2G(J)); | ||
241 | CTInfo sinfo = s->info; | 242 | CTInfo sinfo = s->info; |
242 | lua_assert(!ctype_isenum(sinfo)); | 243 | lua_assert(!ctype_isenum(sinfo)); |
243 | if (ctype_isnum(sinfo)) { | 244 | if (ctype_isnum(sinfo)) { |
@@ -249,8 +250,8 @@ static TRef crec_tv_ct(jit_State *J, CType *s, CTypeID sid, TRef sp) | |||
249 | return emitir(IRT(IR_XLOAD, t), sp, 0); | 250 | return emitir(IRT(IR_XLOAD, t), sp, 0); |
250 | } else if (ctype_isrefarray(sinfo) || ctype_isstruct(sinfo)) { | 251 | } else if (ctype_isrefarray(sinfo) || ctype_isstruct(sinfo)) { |
251 | /* Create reference. */ | 252 | /* Create reference. */ |
252 | UNUSED(sid); lj_trace_err(J, LJ_TRERR_NYICONV); | 253 | CTypeID refid = lj_ctype_intern(cts, CTINFO_REF(sid), CTSIZE_PTR); |
253 | return 0; | 254 | return emitir(IRTG(IR_CNEWI, IRT_CDATA), sp, lj_ir_kint(J, refid)); |
254 | } else { | 255 | } else { |
255 | copyval: /* Copy value. */ | 256 | copyval: /* Copy value. */ |
256 | lj_trace_err(J, LJ_TRERR_NYICONV); | 257 | lj_trace_err(J, LJ_TRERR_NYICONV); |
@@ -281,7 +282,7 @@ static void crec_ct_tv(jit_State *J, CType *d, TRef dp, TRef sp, TValue *sval) | |||
281 | s = ctype_raw(cts, sid); | 282 | s = ctype_raw(cts, sid); |
282 | if (ctype_isptr(s->info)) { | 283 | if (ctype_isptr(s->info)) { |
283 | IRType t = (LJ_64 && s->size == 8) ? IRT_P64 : IRT_P32; | 284 | IRType t = (LJ_64 && s->size == 8) ? IRT_P64 : IRT_P32; |
284 | sp = emitir(IRT(IR_FLOAD, t), sp, IRFL_CDATA_DATA); | 285 | sp = emitir(IRT(IR_FLOAD, t), sp, IRFL_CDATA_INIT1); |
285 | if (ctype_isref(s->info)) | 286 | if (ctype_isref(s->info)) |
286 | s = ctype_rawchild(cts, s); | 287 | s = ctype_rawchild(cts, s); |
287 | else | 288 | else |
@@ -316,7 +317,7 @@ void LJ_FASTCALL recff_cdata_index(jit_State *J, RecordFFData *rd) | |||
316 | if (ctype_isptr(ct->info)) { | 317 | if (ctype_isptr(ct->info)) { |
317 | IRType t = (LJ_64 && ct->size == 8) ? IRT_P64 : IRT_P32; | 318 | IRType t = (LJ_64 && ct->size == 8) ? IRT_P64 : IRT_P32; |
318 | if (ctype_isref(ct->info)) ct = ctype_rawchild(cts, ct); | 319 | if (ctype_isref(ct->info)) ct = ctype_rawchild(cts, ct); |
319 | ptr = emitir(IRT(IR_FLOAD, t), ptr, IRFL_CDATA_DATA); | 320 | ptr = emitir(IRT(IR_FLOAD, t), ptr, IRFL_CDATA_INIT1); |
320 | ofs = 0; | 321 | ofs = 0; |
321 | } | 322 | } |
322 | 323 | ||