Lua 5.1.3 Copyright (C) 1994-2008 Lua.org, PUC-Rio
j = 1e4
co = coroutine.create(function() t = {} for i = 1, j do t[i] = i end return unpack(t) end)
print(coroutine.resume(co))
Segmentation fault
this appears to only happen in Lua 5.1.3, 5.1.2 correctly catches this:
Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio
j = 1e4
co = coroutine.create(function() t = {} for i = 1, j do t[i] = i end return unpack(t) end)
print(coroutine.resume(co))
false stdin:1: stack overflow (table too big to unpack)
You may need to play with values for 'j'.