diff options
Diffstat (limited to '')
-rw-r--r-- | src/lj_record.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index 9d0021a6..134fad83 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -1599,10 +1599,16 @@ TRef lj_record_idx(jit_State *J, RecordIndex *ix) | |||
1599 | lj_assertJ(!hasmm, "inconsistent metamethod handling"); | 1599 | lj_assertJ(!hasmm, "inconsistent metamethod handling"); |
1600 | if (oldv == niltvg(J2G(J))) { /* Need to insert a new key. */ | 1600 | if (oldv == niltvg(J2G(J))) { /* Need to insert a new key. */ |
1601 | TRef key = ix->key; | 1601 | TRef key = ix->key; |
1602 | if (tref_isinteger(key)) /* NEWREF needs a TValue as a key. */ | 1602 | if (tref_isinteger(key)) { /* NEWREF needs a TValue as a key. */ |
1603 | key = emitir(IRTN(IR_CONV), key, IRCONV_NUM_INT); | 1603 | key = emitir(IRTN(IR_CONV), key, IRCONV_NUM_INT); |
1604 | else if (tref_isnumber(key) && tref_isk(key) && tvismzero(&ix->keyv)) | 1604 | } else if (tref_isnum(key)) { |
1605 | key = lj_ir_knum_zero(J); /* Canonicalize -0.0 to +0.0. */ | 1605 | if (tref_isk(key)) { |
1606 | if (tvismzero(&ix->keyv)) | ||
1607 | key = lj_ir_knum_zero(J); /* Canonicalize -0.0 to +0.0. */ | ||
1608 | } else { | ||
1609 | emitir(IRTG(IR_EQ, IRT_NUM), key, key); /* Check for !NaN. */ | ||
1610 | } | ||
1611 | } | ||
1606 | xref = emitir(IRT(IR_NEWREF, IRT_PGC), ix->tab, key); | 1612 | xref = emitir(IRT(IR_NEWREF, IRT_PGC), ix->tab, key); |
1607 | keybarrier = 0; /* NEWREF already takes care of the key barrier. */ | 1613 | keybarrier = 0; /* NEWREF already takes care of the key barrier. */ |
1608 | #ifdef LUAJIT_ENABLE_TABLE_BUMP | 1614 | #ifdef LUAJIT_ENABLE_TABLE_BUMP |