summaryrefslogtreecommitdiff
path: root/src/lj_crecord.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_crecord.c')
-rw-r--r--src/lj_crecord.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c
index 49b2341a..2a475035 100644
--- a/src/lj_crecord.c
+++ b/src/lj_crecord.c
@@ -483,16 +483,8 @@ static void crec_index_meta(jit_State *J, CTState *cts, CType *ct,
483 } else if (rd->data == 0 && tvistab(tv) && tref_isstr(J->base[1])) { 483 } else if (rd->data == 0 && tvistab(tv) && tref_isstr(J->base[1])) {
484 /* Specialize to result of __index lookup. */ 484 /* Specialize to result of __index lookup. */
485 cTValue *o = lj_tab_get(J->L, tabV(tv), &rd->argv[1]); 485 cTValue *o = lj_tab_get(J->L, tabV(tv), &rd->argv[1]);
486 IRType t = itype2irt(o); 486 J->base[0] = lj_record_constify(J, o);
487 if (tvisgcv(o)) 487 if (!J->base[0])
488 J->base[0] = lj_ir_kgc(J, gcV(o), t);
489 else if (tvisint(o))
490 J->base[0] = lj_ir_kint(J, intV(o));
491 else if (tvisnum(o))
492 J->base[0] = lj_ir_knumint(J, numV(o));
493 else if (tvisbool(o))
494 J->base[0] = TREF_PRI(t);
495 else
496 lj_trace_err(J, LJ_TRERR_BADTYPE); 488 lj_trace_err(J, LJ_TRERR_BADTYPE);
497 /* Always specialize to the key. */ 489 /* Always specialize to the key. */
498 emitir(IRTG(IR_EQ, IRT_STR), J->base[1], lj_ir_kstr(J, strV(&rd->argv[1]))); 490 emitir(IRTG(IR_EQ, IRT_STR), J->base[1], lj_ir_kstr(J, strV(&rd->argv[1])));