Parameters for 'lua_createtable' back to int

Tables don't accept sizes larger than int.
This commit is contained in:
Roberto Ierusalimschy
2025-01-21 13:33:59 -03:00
parent 724012d3d0
commit 7d7ae8781e
7 changed files with 18 additions and 16 deletions

View File

@@ -35,8 +35,10 @@ do print "testing 'table.create'"
assert(memdiff > 1024 * 12)
assert(not T or select(2, T.querytab(t)) == 1024)
checkerror("table overflow", table.create, (1<<31) + 1)
checkerror("table overflow", table.create, 0, (1<<31) + 1)
local maxint1 = 1 << (string.packsize("i") * 8 - 1)
checkerror("out of range", table.create, maxint1)
checkerror("out of range", table.create, 0, maxint1)
checkerror("table overflow", table.create, 0, maxint1 - 1)
end