diff options
-rw-r--r-- | ltests.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.167 2014/02/19 13:51:09 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.168 2014/04/14 18:42:44 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -570,7 +570,9 @@ static int mem_query (lua_State *L) { | |||
570 | return 3; | 570 | return 3; |
571 | } | 571 | } |
572 | else if (lua_isnumber(L, 1)) { | 572 | else if (lua_isnumber(L, 1)) { |
573 | l_memcontrol.memlimit = luaL_checkint(L, 1); | 573 | unsigned long limit = cast(unsigned long, luaL_checkinteger(L, 1)); |
574 | if (limit == 0) limit = ULONG_MAX; | ||
575 | l_memcontrol.memlimit = limit; | ||
574 | return 0; | 576 | return 0; |
575 | } | 577 | } |
576 | else { | 578 | else { |
@@ -755,7 +757,7 @@ static int upvalue (lua_State *L) { | |||
755 | 757 | ||
756 | 758 | ||
757 | static int newuserdata (lua_State *L) { | 759 | static int newuserdata (lua_State *L) { |
758 | size_t size = luaL_checkint(L, 1); | 760 | size_t size = cast(size_t, luaL_checkinteger(L, 1)); |
759 | char *p = cast(char *, lua_newuserdata(L, size)); | 761 | char *p = cast(char *, lua_newuserdata(L, size)); |
760 | while (size--) *p++ = '\0'; | 762 | while (size--) *p++ = '\0'; |
761 | return 1; | 763 | return 1; |