commit 4ba0cb4580969a42748e2f4f617ab16fdcb1d7ca
parent a30c66f0fc17bf733c2289a0d7a76930dac80f47
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Sat, 7 Mar 2015 16:29:51 -0300
always use macros to operate on lua_Numbers
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lvm.c b/lvm.c
@@ -1,5 +1,5 @@
/*
-** $Id: lvm.c,v 2.235 2015/02/20 14:27:53 roberto Exp roberto $
+** $Id: lvm.c,v 2.236 2015/03/02 16:04:52 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -127,7 +127,7 @@ static int forlimit (const TValue *obj, lua_Integer *p, lua_Integer step,
lua_Number n; /* try to convert to float */
if (!tonumber(obj, &n)) /* cannot convert to float? */
return 0; /* not a number */
- if (n > 0) { /* if true, float is larger than max integer */
+ if (luai_numlt(0, n)) { /* if true, float is larger than max integer */
*p = LUA_MAXINTEGER;
if (step < 0) *stopnow = 1;
}