Avoid tracing the nil return case of tonumber().

This commit is contained in:
Mike Pall 2010-03-09 03:47:49 +01:00
parent d87cb5b526
commit 6e6034e809

View File

@ -1237,8 +1237,12 @@ static void LJ_FASTCALL recff_tonumber(jit_State *J, RecordFFData *rd)
if (!tref_isk(base) || IR(tref_ref(base))->i != 10) if (!tref_isk(base) || IR(tref_ref(base))->i != 10)
recff_nyiu(J); recff_nyiu(J);
} }
if (tref_isstr(tr)) if (tref_isstr(tr)) {
TValue tmp;
if (!lj_str_tonum(strV(&rd->argv[0]), &tmp))
recff_nyiu(J); /* Would need an inverted STRTO for this case. */
tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0); tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0);
}
} else { } else {
tr = TREF_NIL; tr = TREF_NIL;
} }