Fix recording of equality comparisons with __eq metamethods.

This commit is contained in:
Mike Pall 2012-10-19 17:03:41 +02:00
parent f1fe96e7ef
commit 614e78d1f6

View File

@ -1808,12 +1808,10 @@ void lj_record_ins(jit_State *J)
int diff; int diff;
rec_comp_prep(J); rec_comp_prep(J);
diff = lj_record_objcmp(J, ra, rc, rav, rcv); diff = lj_record_objcmp(J, ra, rc, rav, rcv);
if (diff == 1 && (tref_istab(ra) || tref_isudata(ra))) { if (diff == 2 || !(tref_istab(ra) || tref_isudata(ra)))
/* Only check __eq if different, but the same type (table or udata). */
rec_mm_equal(J, &ix, (int)op);
break;
}
rec_comp_fixup(J, J->pc, ((int)op & 1) == !diff); rec_comp_fixup(J, J->pc, ((int)op & 1) == !diff);
else if (diff == 1) /* Only check __eq if different, but same type. */
rec_mm_equal(J, &ix, (int)op);
} }
break; break;