lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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'.

-- 
-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."

-Will Durant