fix(util/script_state): weird crash with Lua 5.1

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-08-09 23:13:30 -07:00
parent 8ad0949269
commit 19daefaec5

View file

@ -81,6 +81,8 @@ struct script_state::imp {
if (g_check_interrupt_freq > 0) {
lua_sethook(m_state, check_interrupted_hook, LUA_MASKCOUNT, g_check_interrupt_freq);
}
if (!lua_checkstack(m_state, 1024))
throw exception("lua_checkstack failed");
luaL_openlibs(m_state);
open_exception(m_state);
open_name(m_state);