lua-users home
lua-l archive

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


I don't mean to keep banging a dead horse, but this is not workable for me
in my situation. I only bring this up because I think it may affect others.
Within the application context that I work in, I develop various lua_States
as services within the larger application. Users (in C++) of the services I
provide can get access to various bits of Lua data, and manipulate that data
(call functions, set values, etc.). Unfortunately, this means that they can
also do illegal things with the data, and it is not always possible for me
to wrap their calls with lua_call(). So for these cases, I need a more
robust error-handling mecahnism than exit()

Eric

> -----Original Message-----
> From: owner-lua-l@tecgraf.puc-rio.br
> [mailto:owner-lua-l@tecgraf.puc-rio.br]On Behalf Of Luiz Henrique de
> Figueiredo
> Sent: Monday, November 19, 2001 4:07 PM
> To: Multiple recipients of list
> Subject: Re: customizable Lua "panic" behavior
>
>
> >What about using setjmp and longjmp?
>
> This is essentially my suggestion to run your C code as a Lua C function
> via lua_call. Lua then will set up things so that there will be a jmp_buf
> to longjmp to and the exit path will never be taken. I think this
> solution is
> much cleaner and does not need any fiddling with the internals of Lua and
> so I recommend it.
> --lhf
>