Re: C++ exceptions under Windows x86

  • From: Mike Pall <mike-1301@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 3 Jan 2013 22:16:01 +0100

Szymon Gatner wrote:
> I did read "C++ Exception Interoperability" section (I am on Win32 /
> Visual Studio 2008) but I am not sure I understand limitations. My
> understanding is that I am not throwing across Lua frames. Also I dont
> get the term "throwing Lua errors".

lua_error() is "throwing a Lua error", because it actually unwinds
C stack frames.

Your problem sounds like an interaction with C++ RAII (automatic
destructors). Because this implicitly sets up SEH frames and those
get messed up when lua_error() unwinds the stack.

So check your code for uses of RAII. AFAIR Luabind has (or had?)
some of these internally, too.

[Anyway, Luabind has a high binding overhead and most of the CPU
time is probably spent there. LuaJIT is not going to help you with
that.]

--Mike

Other related posts: