mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Fixed undefined behaviour when love exceptions are converted into Lua errors (resolves issue #729)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user