resume_function and errors

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

resume_function and errors

Jason McKesson
According to Lua's documentation, `lua_pcall` unwinds the stack after an
error. But `lua_resume` does *not*. Because of that, I keep hitting an
assert in the proxy function call destructor:

                     if (m_called) return;

                     m_called = true;
                     lua_State* L = m_state;

                     int top = lua_gettop(L);

                     push_args_from_tuple<1>::apply(L, m_args);
                     if (m_fun(L, boost::tuples::length<Tuple>::value, 0))
                         assert(lua_gettop(L) == top - m_params + 1);
                         throw luabind::error(L);
                         error_callback_fun e = get_error_callback();
                         if (e) e(L);

                         assert(0 && "the lua function threw an error
and exceptions are disabled."
                                 " If you want to handle the error you
can use luabind::set_error_callback()");
                     // pops the return values from the function call
                     stack_pop pop(L, lua_gettop(L) - top + m_params);

The assert itself seems to be pointless when using `resume` and

Is this a valid bug, or is there something else I should be doing when
using Lua threads?

All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
luabind-user mailing list
[hidden email]