lua-users home
lua-l archive

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


> Lua flags a stack overflow assertion in the following simple code
> (both in 5.1 and 5.2). It is a small extension to the previous
> example, but this one keeps a reference to thread L in the registry:
> 
> 
> [...]
> 
> Is L in some invalid state after yielding in the hook? Is the stack
> not usable? Is the registry corrupt?

Yes, L is in an invalid state, because it yielded. While it is suspended,
you cannot change its stack. More specifically, the thread "thinks"
it is running a Lua function (because it was inside a Lua function when
it yielded), so it is not ready to accept API operations.

-- Roberto