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

  • From: Geoff Leyland <geoff_leyland@xxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Mon, 23 Jul 2012 10:18:06 +1200

On 23/07/2012, at 9:33 AM, Mark Tolley wrote:

> Ok, here's the complete code:

The equivalent works for me on OS X, so I'm afraid I can't help much.  Are you 
sure that it's the lua_error line that's the problem?  Have you checked that 
luaL_newstate is not returning null?

extern "C"
{
#include "lauxlib.h"
#include <stdio.h>
}

int main(void)
{
  lua_State *L = luaL_newstate();
  lua_pushliteral(L, "literal");
  try
  {
    lua_error(L);
  }
  catch (...)
  {
    fprintf(stderr, "caught it!\n");
    return 1;
  }
  return 0;
}


Other related posts: