From 4e945d25ecf0dce642145445d8ee7bb8b882ea38 Mon Sep 17 00:00:00 2001 From: Luke Gorrie Date: Sun, 13 Aug 2017 14:14:14 +0000 Subject: [PATCH] lj_api.c: Fix breakage in cherry-pick of ffd2610139125e6145b5b10af52fda3d07fb8b9e Had failed to remove some DUALNUM code that does not apply to RaptorJIT. --- src/lj_api.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/lj_api.c b/src/lj_api.c index 2a06fc8327..0412c1a568 100644 --- a/src/lj_api.c +++ b/src/lj_api.c @@ -376,8 +376,6 @@ LUA_API lua_Integer lua_tointeger(lua_State *L, int idx) } else { if (!(tvisstr(o) && lj_strscan_number(strV(o), &tmp))) return 0; - if (tvisint(&tmp)) - return intV(&tmp); n = numV(&tmp); } return (lua_Integer)n; @@ -388,20 +386,13 @@ LUA_API lua_Integer lua_tointegerx(lua_State *L, int idx, int *ok) cTValue *o = index2adr(L, idx); TValue tmp; lua_Number n; - if (LJ_LIKELY(tvisint(o))) { - if (ok) *ok = 1; - return intV(o); - } else if (LJ_LIKELY(tvisnum(o))) { + if (LJ_LIKELY(tvisnum(o))) { n = numV(o); } else { if (!(tvisstr(o) && lj_strscan_number(strV(o), &tmp))) { if (ok) *ok = 0; return 0; } - if (tvisint(&tmp)) { - if (ok) *ok = 1; - return intV(&tmp); - } n = numV(&tmp); } if (ok) *ok = 1;