mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
Merge branch 'master' into v2.1
This commit is contained in:
commit
9bd2404137
@ -1972,7 +1972,10 @@ LJFOLD(NE any any)
|
||||
LJFOLDF(comm_equal)
|
||||
{
|
||||
/* For non-numbers only: x == x ==> drop; x ~= x ==> fail */
|
||||
if (fins->op1 == fins->op2 && !irt_isnum(fins->t))
|
||||
if (fins->op1 == fins->op2 &&
|
||||
(!irt_isnum(fins->t) ||
|
||||
(fleft->o == IR_CONV && /* Converted integers cannot be NaN. */
|
||||
(uint32_t)(fleft->op2 & IRCONV_SRCMASK) - (uint32_t)IRT_I8 <= (uint32_t)(IRT_U64 - IRT_U8))))
|
||||
return CONDFOLD(fins->o == IR_EQ);
|
||||
return fold_comm_swap(J);
|
||||
}
|
||||
|
@ -1599,10 +1599,16 @@ TRef lj_record_idx(jit_State *J, RecordIndex *ix)
|
||||
lj_assertJ(!hasmm, "inconsistent metamethod handling");
|
||||
if (oldv == niltvg(J2G(J))) { /* Need to insert a new key. */
|
||||
TRef key = ix->key;
|
||||
if (tref_isinteger(key)) /* NEWREF needs a TValue as a key. */
|
||||
if (tref_isinteger(key)) { /* NEWREF needs a TValue as a key. */
|
||||
key = emitir(IRTN(IR_CONV), key, IRCONV_NUM_INT);
|
||||
else if (tref_isnumber(key) && tref_isk(key) && tvismzero(&ix->keyv))
|
||||
} else if (tref_isnum(key)) {
|
||||
if (tref_isk(key)) {
|
||||
if (tvismzero(&ix->keyv))
|
||||
key = lj_ir_knum_zero(J); /* Canonicalize -0.0 to +0.0. */
|
||||
} else {
|
||||
emitir(IRTG(IR_EQ, IRT_NUM), key, key); /* Check for !NaN. */
|
||||
}
|
||||
}
|
||||
xref = emitir(IRT(IR_NEWREF, IRT_PGC), ix->tab, key);
|
||||
keybarrier = 0; /* NEWREF already takes care of the key barrier. */
|
||||
#ifdef LUAJIT_ENABLE_TABLE_BUMP
|
||||
|
Loading…
Reference in New Issue
Block a user