From 5205f073c57ae4b69e90d35c02e3a1a1cca44eb4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 24 Feb 2021 12:24:42 -0300 Subject: Don't use tointegerns when luaV_tointegerns will do Some places don't need the "fast path" macro tointegerns, either because speed is not essential (lcode.c) or because the value is not supposed to be an integer already (luaV_equalobj and luaG_tointerror). Moreover, luaV_equalobj should always use F2Ieq, even if Lua is compiled to "round to floor". --- ldebug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ldebug.c') diff --git a/ldebug.c b/ldebug.c index 0038d1b3..603c39fc 100644 --- a/ldebug.c +++ b/ldebug.c @@ -726,7 +726,7 @@ l_noret luaG_opinterror (lua_State *L, const TValue *p1, */ l_noret luaG_tointerror (lua_State *L, const TValue *p1, const TValue *p2) { lua_Integer temp; - if (!tointegerns(p1, &temp)) + if (!luaV_tointegerns(p1, &temp, LUA_FLOORN2I)) p2 = p1; luaG_runerror(L, "number%s has no integer representation", varinfo(L, p2)); } -- cgit v1.2.3-55-g6feb