Fixed undefined behaviour when love exceptions are converted into Lua errors (resolves issue #729)

This commit is contained in:
Alex Szpakowski
2013-09-05 23:17:29 -03:00
parent 389e99bf2c
commit 06f80d5c08
45 changed files with 349 additions and 873 deletions
+1 -8
View File
@@ -98,14 +98,7 @@ RandomGenerator *luax_checkrandomgenerator(lua_State *L, int idx)
int w_RandomGenerator_setState(lua_State *L)
{
RandomGenerator *rng = luax_checkrandomgenerator(L, 1);
try
{
rng->setState(luax_checkrandomstate(L, 2));
}
catch (love::Exception &e)
{
return luaL_error(L, "%s", e.what());
}
EXCEPT_GUARD(rng->setState(luax_checkrandomstate(L, 2));)
return 0;
}