lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I've read the Lua manual, but still not sure about the following code:

   int errcode = luaL_loadfile(L, filename);
   if (errcode > 0)
   {
      const char* msg = lua_tostring(L, -1);
      lua_pop(L, 1);
      throw LuaError(msg);
   }

Does Lua guarantee that LuaError would be instantiated with valid msg
string or I should copy it before doing lua_pop?