mirror of
https://github.com/moparisthebest/minetest
synced 2024-11-17 14:55:13 -05:00
dofile error reporting for syntax errors
According to doc, dofile() raises an error when parsing failed due to syntax errors. Fixes #2775
This commit is contained in:
parent
0b187ede4b
commit
502e40a649
@ -407,7 +407,8 @@ int ScriptApiSecurity::sl_g_dofile(lua_State *L)
|
|||||||
{
|
{
|
||||||
int nret = sl_g_loadfile(L);
|
int nret = sl_g_loadfile(L);
|
||||||
if (nret != 1) {
|
if (nret != 1) {
|
||||||
return nret;
|
lua_error(L);
|
||||||
|
// code after this function isn't executed
|
||||||
}
|
}
|
||||||
int top_precall = lua_gettop(L);
|
int top_precall = lua_gettop(L);
|
||||||
lua_call(L, 0, LUA_MULTRET);
|
lua_call(L, 0, LUA_MULTRET);
|
||||||
|
Loading…
Reference in New Issue
Block a user