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

@@ -539,10 +539,8 @@ static void LJ_FASTCALL recff_math_degrad(jit_State *J, RecordFFData *rd)
static void LJ_FASTCALL recff_math_pow(jit_State *J, RecordFFData *rd)
{
TRef tr = lj_ir_tonum(J, J->base[0]);
if (!tref_isnumber_str(J->base[1]))
lj_trace_err(J, LJ_TRERR_BADTYPE);
J->base[0] = lj_opt_narrow_pow(J, tr, J->base[1], &rd->argv[1]);
J->base[0] = lj_opt_narrow_pow(J, J->base[0], J->base[1],
&rd->argv[0], &rd->argv[1]);
UNUSED(rd);
}