aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lj_ffrecord.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lj_ffrecord.c b/src/lj_ffrecord.c
index 1233e5f7..151c4c8c 100644
--- a/src/lj_ffrecord.c
+++ b/src/lj_ffrecord.c
@@ -1444,6 +1444,15 @@ static void LJ_FASTCALL recff_table_new(jit_State *J, RecordFFData *rd)
1444{ 1444{
1445 TRef tra = lj_opt_narrow_toint(J, J->base[0]); 1445 TRef tra = lj_opt_narrow_toint(J, J->base[0]);
1446 TRef trh = lj_opt_narrow_toint(J, J->base[1]); 1446 TRef trh = lj_opt_narrow_toint(J, J->base[1]);
1447 if (tref_isk(tra) && tref_isk(trh)) {
1448 int32_t a = IR(tref_ref(tra))->i;
1449 if (a < 0x7fff) {
1450 uint32_t hbits = hsize2hbits(IR(tref_ref(trh))->i);
1451 a = a > 0 ? a+1 : 0;
1452 J->base[0] = emitir(IRTG(IR_TNEW, IRT_TAB), (uint32_t)a, hbits);
1453 return;
1454 }
1455 }
1447 J->base[0] = lj_ir_call(J, IRCALL_lj_tab_new_ah, tra, trh); 1456 J->base[0] = lj_ir_call(J, IRCALL_lj_tab_new_ah, tra, trh);
1448 UNUSED(rd); 1457 UNUSED(rd);
1449} 1458}