Re: Luajit crashes when I call lua_error (C++ MSVC x64)

  • From: Mark Tolley <marktolley7@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 22 Jul 2012 22:33:11 +0100

On 22/07/2012 22:27, Geoff Leyland wrote:
On 23/07/2012, at 9:11 AM, Mark Tolley wrote:

I've tried wrapping the lua_error call in a try-catch and it still crashes.
What are you trying to catch?  You need to catch lua_errors with catch(...).  
You would get more useful help if you posted more complete code.

The error message from the debugger is also different than if I just put in a 
random throw new std::exception(); at the top of main, which results in this:
Those error messages look the same to me.  It looks like it's pointing to where 
an exception that you didn't catch was thrown.  What are you expecting to see?

Ok, here's the complete code:

int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
    lua_State *L = luaL_newstate();
    lua_pushliteral(L, "literal");
    catch (...)
        return 1;
    return 0;

    // rest of my code commented out


Other related posts: