lua-users home
lua-l archive

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



On 16-Mar-05, at 2:41 PM, Mark Hamburg wrote:

* Set the status value in a Lua state before calling the panic function.

In ldo.c, we add the following line to luaD_throw just before it calls
panic.

    L->status = errcode;

This allows panic functions to see the error code and take appropriate
action such as translating into some other exception system. As with the lauxlib.c patch above, a nicer approach would be figuring out how to get the
effect of lua_cpcall without the convoluted code required to use it.

It would also be nice if you could provide a void* argument for the panic function.