aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-09-10 11:34:42 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-09-10 11:34:42 -0300
commit9f0c0fe0de64bc41efea73a2da881ff0a1036a03 (patch)
tree684f2919e50ad8793542e556576907140c544aee /lapi.c
parent782ef85b22f89d1cd1ab083202f018668d26e4b0 (diff)
downloadlua-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lapi.c b/lapi.c
index 332e97d1..04e09cff 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1343,7 +1343,7 @@ void lua_warning (lua_State *L, const char *msg, int tocont) {
1343LUA_API void *lua_newuserdatauv (lua_State *L, size_t size, int nuvalue) { 1343LUA_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);