Fix handling of non-numeric strings in arithmetic coercions.

Thanks to Vyacheslav Egorov.
This commit is contained in:
Mike Pall
2016-04-21 17:00:58 +02:00
parent cc4f5d056a
commit 2f0001fad0
4 changed files with 28 additions and 28 deletions

View File

@@ -1884,14 +1884,14 @@ void lj_record_ins(jit_State *J)
case BC_MODVN: case BC_MODVV:
recmod:
if (tref_isnumber_str(rb) && tref_isnumber_str(rc))
rc = lj_opt_narrow_mod(J, rb, rc, rcv);
rc = lj_opt_narrow_mod(J, rb, rc, rbv, rcv);
else
rc = rec_mm_arith(J, &ix, MM_mod);
break;
case BC_POW:
if (tref_isnumber_str(rb) && tref_isnumber_str(rc))
rc = lj_opt_narrow_pow(J, lj_ir_tonum(J, rb), rc, rcv);
rc = lj_opt_narrow_pow(J, rb, rc, rbv, rcv);
else
rc = rec_mm_arith(J, &ix, MM_pow);
break;