浏览代码

always use macros to operate on lua_Numbers

Roberto Ierusalimschy 10 年之前
父节点
当前提交
4ba0cb4580
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      lvm.c

+ 2 - 2
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;
     }