aboutsummaryrefslogtreecommitdiff
path: root/src/lj_crecord.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_crecord.c')
-rw-r--r--src/lj_crecord.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c
index c3b01f63..87f58256 100644
--- a/src/lj_crecord.c
+++ b/src/lj_crecord.c
@@ -619,7 +619,7 @@ static TRef crec_ct_tv(jit_State *J, CType *d, TRef dp, TRef sp, cTValue *sval)
619 emitir(IRTGI(IR_EQ), tr, lj_ir_kint(J, UDTYPE_IO_FILE)); 619 emitir(IRTGI(IR_EQ), tr, lj_ir_kint(J, UDTYPE_IO_FILE));
620 sp = emitir(IRT(IR_FLOAD, IRT_PTR), sp, IRFL_UDATA_FILE); 620 sp = emitir(IRT(IR_FLOAD, IRT_PTR), sp, IRFL_UDATA_FILE);
621 } else { 621 } else {
622 sp = emitir(IRT(IR_ADD, IRT_P32), sp, lj_ir_kint(J, sizeof(GCudata))); 622 sp = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, sizeof(GCudata)));
623 } 623 }
624 } else if (tref_isstr(sp)) { 624 } else if (tref_isstr(sp)) {
625 if (ctype_isenum(d->info)) { /* Match string against enum constant. */ 625 if (ctype_isenum(d->info)) { /* Match string against enum constant. */
@@ -637,7 +637,8 @@ static TRef crec_ct_tv(jit_State *J, CType *d, TRef dp, TRef sp, cTValue *sval)
637 } else if (ctype_isrefarray(d->info)) { /* Copy string to array. */ 637 } else if (ctype_isrefarray(d->info)) { /* Copy string to array. */
638 lj_trace_err(J, LJ_TRERR_BADTYPE); /* NYI */ 638 lj_trace_err(J, LJ_TRERR_BADTYPE); /* NYI */
639 } else { /* Otherwise pass the string data as a const char[]. */ 639 } else { /* Otherwise pass the string data as a const char[]. */
640 sp = emitir(IRT(IR_STRREF, IRT_P32), sp, lj_ir_kint(J, 0)); 640 /* Don't use STRREF. It folds with SNEW, which loses the trailing NUL. */
641 sp = emitir(IRT(IR_ADD, IRT_PTR), sp, lj_ir_kintp(J, sizeof(GCstr)));
641 sid = CTID_A_CCHAR; 642 sid = CTID_A_CCHAR;
642 } 643 }
643 } else { /* NYI: tref_istab(sp), tref_islightud(sp). */ 644 } else { /* NYI: tref_istab(sp), tref_islightud(sp). */