diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-11-15 12:04:53 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-11-15 12:04:53 -0300 |
commit | a4762b6ffe74f5878882ef238d37bfa92d90e418 (patch) | |
tree | 4f52a82641838a318e6270522d9e7f83ccab388d /lstate.c | |
parent | d4247befa18a7911c56e7110154ad73574cd6648 (diff) | |
download | lua-a4762b6ffe74f5878882ef238d37bfa92d90e418.tar.gz lua-a4762b6ffe74f5878882ef238d37bfa92d90e418.tar.bz2 lua-a4762b6ffe74f5878882ef238d37bfa92d90e418.zip |
'objsize' returns 'l_mem'
Sums of size_t may not fit in a size_t.
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -257,8 +257,9 @@ static void preinit_thread (lua_State *L, global_State *g) { | |||
257 | } | 257 | } |
258 | 258 | ||
259 | 259 | ||
260 | size_t luaE_threadsize (lua_State *L) { | 260 | lu_mem luaE_threadsize (lua_State *L) { |
261 | size_t sz = sizeof(LX) + cast_uint(L->nci) * sizeof(CallInfo); | 261 | lu_mem sz = cast(lu_mem, sizeof(LX)) |
262 | + cast_uint(L->nci) * sizeof(CallInfo); | ||
262 | if (L->stack.p != NULL) | 263 | if (L->stack.p != NULL) |
263 | sz += cast_uint(stacksize(L) + EXTRA_STACK) * sizeof(StackValue); | 264 | sz += cast_uint(stacksize(L) + EXTRA_STACK) * sizeof(StackValue); |
264 | return sz; | 265 | return sz; |