diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-06-19 11:27:00 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-06-19 11:27:00 -0300 |
commit | 130c0e40e01e24a79f7e416d1cc4187cd4a2a5fc (patch) | |
tree | 946ed95a3c70012ba57e0be4abdd4a5e7263fc44 /lvm.c | |
parent | c72fb1cf8e0869aa4adc894c4e28f9d1be2e6574 (diff) | |
download | lua-130c0e40e01e24a79f7e416d1cc4187cd4a2a5fc.tar.gz lua-130c0e40e01e24a79f7e416d1cc4187cd4a2a5fc.tar.bz2 lua-130c0e40e01e24a79f7e416d1cc4187cd4a2a5fc.zip |
new constant 'MAX_SIZE', distinct from 'MAX_SIZET', for sizes visible
from Lua; these must fit in a lua_Integer
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.172 2013/06/04 19:36:42 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.173 2013/06/07 19:02:05 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -284,7 +284,7 @@ void luaV_concat (lua_State *L, int total) { | |||
284 | /* collect total length */ | 284 | /* collect total length */ |
285 | for (i = 1; i < total && tostring(L, top-i-1); i++) { | 285 | for (i = 1; i < total && tostring(L, top-i-1); i++) { |
286 | size_t l = tsvalue(top-i-1)->len; | 286 | size_t l = tsvalue(top-i-1)->len; |
287 | if (l >= (MAX_SIZET/sizeof(char)) - tl) | 287 | if (l >= (MAX_SIZE/sizeof(char)) - tl) |
288 | luaG_runerror(L, "string length overflow"); | 288 | luaG_runerror(L, "string length overflow"); |
289 | tl += l; | 289 | tl += l; |
290 | } | 290 | } |