diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-09-10 11:34:42 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-09-10 11:34:42 -0300 |
commit | 9f0c0fe0de64bc41efea73a2da881ff0a1036a03 (patch) | |
tree | 684f2919e50ad8793542e556576907140c544aee /lapi.c | |
parent | 782ef85b22f89d1cd1ab083202f018668d26e4b0 (diff) | |
download | lua-9f0c0fe0de64bc41efea73a2da881ff0a1036a03.tar.gz lua-9f0c0fe0de64bc41efea73a2da881ff0a1036a03.tar.bz2 lua-9f0c0fe0de64bc41efea73a2da881ff0a1036a03.zip |
Bug: Wrong limit for local variables in 16-bit systems
USHRT_MAX does not fit in an 'int' in 16-bit systems.
Diffstat (limited to '')
-rw-r--r-- | lapi.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1343,7 +1343,7 @@ void lua_warning (lua_State *L, const char *msg, int tocont) { | |||
1343 | LUA_API void *lua_newuserdatauv (lua_State *L, size_t size, int nuvalue) { | 1343 | LUA_API void *lua_newuserdatauv (lua_State *L, size_t size, int nuvalue) { |
1344 | Udata *u; | 1344 | Udata *u; |
1345 | lua_lock(L); | 1345 | lua_lock(L); |
1346 | api_check(L, 0 <= nuvalue && nuvalue < USHRT_MAX, "invalid value"); | 1346 | api_check(L, 0 <= nuvalue && nuvalue < SHRT_MAX, "invalid value"); |
1347 | u = luaS_newudata(L, size, nuvalue); | 1347 | u = luaS_newudata(L, size, nuvalue); |
1348 | setuvalue(L, s2v(L->top.p), u); | 1348 | setuvalue(L, s2v(L->top.p), u); |
1349 | api_incr_top(L); | 1349 | api_incr_top(L); |