aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-04-22 00:34:00 +0200
committerGitHub <noreply@github.com>2017-04-22 00:34:00 +0200
commit113c85a66a5b23c8c47f1bdb435dd4b27884ed54 (patch)
treea882a1c196d0e429de19f52ede2521900d99dbc5 /src/script
parentdc0e9097d3144a3dda81039f666ee43ba29cbc36 (diff)
downloadminetest-113c85a66a5b23c8c47f1bdb435dd4b27884ed54.tar.gz
minetest-113c85a66a5b23c8c47f1bdb435dd4b27884ed54.tar.bz2
minetest-113c85a66a5b23c8c47f1bdb435dd4b27884ed54.zip
lua: remove core.cause_error call (#5637)
it was used in minimal to trigger core crash, not very useful
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_server.cpp33
-rw-r--r--src/script/lua_api/l_server.h5
2 files changed, 0 insertions, 38 deletions
diff --git a/src/script/lua_api/l_server.cpp b/src/script/lua_api/l_server.cpp
index 343d11b7e..6ac4bb653 100644
--- a/src/script/lua_api/l_server.cpp
+++ b/src/script/lua_api/l_server.cpp
@@ -483,36 +483,6 @@ int ModApiServer::l_set_last_run_mod(lua_State *L)
return 0;
}
-#ifndef NDEBUG
-// cause_error(type_of_error)
-int ModApiServer::l_cause_error(lua_State *L)
-{
- NO_MAP_LOCK_REQUIRED;
- std::string type_of_error = "none";
- if(lua_isstring(L, 1))
- type_of_error = lua_tostring(L, 1);
-
- errorstream << "Error handler test called, errortype=" << type_of_error << std::endl;
-
- if(type_of_error == "segv") {
- volatile int* some_pointer = 0;
- errorstream << "Cause a sigsegv now: " << (*some_pointer) << std::endl;
-
- } else if (type_of_error == "zerodivision") {
-
- unsigned int some_number = porting::getTimeS();
- unsigned int zerovalue = 0;
- unsigned int result = some_number / zerovalue;
- errorstream << "Well this shouldn't ever be shown: " << result << std::endl;
-
- } else if (type_of_error == "exception") {
- throw BaseException("Errorhandler test fct called");
- }
-
- return 0;
-}
-#endif
-
void ModApiServer::Initialize(lua_State *L, int top)
{
API_FCT(request_shutdown);
@@ -545,7 +515,4 @@ void ModApiServer::Initialize(lua_State *L, int top)
API_FCT(get_last_run_mod);
API_FCT(set_last_run_mod);
-#ifndef NDEBUG
- API_FCT(cause_error);
-#endif
}
diff --git a/src/script/lua_api/l_server.h b/src/script/lua_api/l_server.h
index ca5e7b80f..008810784 100644
--- a/src/script/lua_api/l_server.h
+++ b/src/script/lua_api/l_server.h
@@ -101,11 +101,6 @@ private:
// set_last_run_mod(modname)
static int l_set_last_run_mod(lua_State *L);
-#ifndef NDEBUG
- // cause_error(type_of_error)
- static int l_cause_error(lua_State *L);
-#endif
-
public:
static void Initialize(lua_State *L, int top);
};