lua-users home
lua-l archive

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


Hm, that's interesting. But doesn't the debug API manipulate the
stack? And, again, is calling lua_close() on the state OK?

Thanks,
Mak

On Mon, Dec 5, 2011 at 3:57 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> Hello, again! What is the state of the usability of the Lua state
>> after a panic? Is it at least safe to close? Is there any behavior I
>> can rely on?
>
> The manual for 5.1 does not say much about this:
>
> "The panic function can access the error message at the top of the stack."
> http://www.lua.org/manual/5.1/manual.html#lua_atpanic
>
> The manual for 5.2 says a bit more, which I think applies to 5.1 as well:
>
> "The panic function should not try to run anything on the failed Lua state.
>  However, it can still use the debug API (see §4.9) to gather information
>  about the state. In particular, the error message is at the top of the stack."
> http://www.lua.org/work/doc/manual.html#lua_atpanic
>