diff --git a/luprex/ext/eris-master/src/ldo.c b/luprex/ext/eris-master/src/ldo.c index 1117d8f4..f85a1856 100644 --- a/luprex/ext/eris-master/src/ldo.c +++ b/luprex/ext/eris-master/src/ldo.c @@ -50,9 +50,12 @@ #if defined(__cplusplus) && !defined(LUA_USE_LONGJMP) /* C++ exceptions */ -#define LUAI_THROW(L,c) throw(c) +class LuaException {}; +#define LUAI_THROW(L,c) throw(LuaException()) +// Do not call the lua interpreter inside a try-catch block. If you do, +// the intepreter state could be corrupted. #define LUAI_TRY(L,c,a) \ - try { a } catch(...) { if ((c)->status == 0) (c)->status = -1; } +try { a } catch(LuaException e) { if ((c)->status == 0) (c)->status = -1; } #define luai_jmpbuf int /* dummy variable */ #elif defined(LUA_USE_ULONGJMP)