C++ exceptions under Windows x86

  • From: Szymon Gatner <szymon.gatner@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 3 Jan 2013 13:56:05 +0100

Hi and Happy New Year!

I was using luabind to glue C++ and Lua and until I moved to LuaJIT I
was happily using exceptions in C++ code. When registering a function
via luabind, every exception thrown from C++ code (when called from
Lua) is caught and and translated to lua_error() which is later
detected in C++ again (lua_pcall fails) which in turn caused
exception. This does not seem to work with LuaJIT anymore.

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". Sorry if this is just me being
stupid but I would really like to know if all my C++/Lua binding is
broken with LuaJIT. Maybe a Wiki article on the matter?

P.S. Am I in trouble under 32 bit OSX / Clang too?

Cheers,
Simon

-- 
Szymon Gatner
The Lordz Games Studio
www.thelordzgamesstudio.com

Other related posts: