new constant 'MAX_SIZE', distinct from 'MAX_SIZET', for sizes visible

from Lua; these must fit in a lua_Integer
This commit is contained in:
Roberto Ierusalimschy
2013-06-19 11:27:00 -03:00
parent c72fb1cf8e
commit 130c0e40e0
4 changed files with 14 additions and 8 deletions

4
lvm.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lvm.c,v 2.172 2013/06/04 19:36:42 roberto Exp roberto $
** $Id: lvm.c,v 2.173 2013/06/07 19:02:05 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -284,7 +284,7 @@ void luaV_concat (lua_State *L, int total) {
/* collect total length */
for (i = 1; i < total && tostring(L, top-i-1); i++) {
size_t l = tsvalue(top-i-1)->len;
if (l >= (MAX_SIZET/sizeof(char)) - tl)
if (l >= (MAX_SIZE/sizeof(char)) - tl)
luaG_runerror(L, "string length overflow");
tl += l;
}