From 5dcc98845092dc0c13259c0f736b3a6e21459340 Mon Sep 17 00:00:00 2001 From: Javier Guerra Date: Fri, 6 Apr 2018 12:12:01 +0100 Subject: [PATCH] bug report #408, when tonumber() is recorded as nil, specialize to the failing ctype --- src/lj_crecord.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lj_crecord.c b/src/lj_crecord.c index fd59e28175..d0e42d6072 100644 --- a/src/lj_crecord.c +++ b/src/lj_crecord.c @@ -1879,6 +1879,8 @@ void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd) d = ctype_get(cts, CTID_DOUBLE); J->base[0] = crec_ct_tv(J, d, 0, J->base[0], &rd->argv[0]); } else { + /* specialize to the ctype that couldn't be converted */ + argv2cdata(J, J->base[0], &rd->argv[0]); J->base[0] = TREF_NIL; } }