aboutsummaryrefslogtreecommitdiff
path: root/src/script/common/c_internal.cpp
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2015-03-06 20:21:51 +1000
committerCraig Robbins <kde.psych@gmail.com>2015-03-07 22:41:47 +1000
commitced6d20295a8263757d57c02a07ffcb66688a163 (patch)
treea44527357c1ffccb88bf479686735aef168d15c1 /src/script/common/c_internal.cpp
parenta603a767877b94b4d3bc4d3de8d762fbc56a583d (diff)
downloadminetest-ced6d20295a8263757d57c02a07ffcb66688a163.tar.gz
minetest-ced6d20295a8263757d57c02a07ffcb66688a163.tar.bz2
minetest-ced6d20295a8263757d57c02a07ffcb66688a163.zip
For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives
Diffstat (limited to 'src/script/common/c_internal.cpp')
-rw-r--r--src/script/common/c_internal.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/script/common/c_internal.cpp b/src/script/common/c_internal.cpp
index f811dd5d3..61248534c 100644
--- a/src/script/common/c_internal.cpp
+++ b/src/script/common/c_internal.cpp
@@ -87,7 +87,7 @@ void script_error(lua_State *L)
// computed depending on mode
void script_run_callbacks(lua_State *L, int nargs, RunCallbacksMode mode)
{
- assert(lua_gettop(L) >= nargs + 1);
+ FATAL_ERROR_IF(lua_gettop(L) < nargs + 1, "Not enough arguments");
// Insert error handler
lua_pushcfunction(L, script_error_handler);
@@ -136,9 +136,7 @@ void log_deprecated(lua_State *L, std::string message)
if (L != NULL) {
script_error(L);
} else {
- /* As of april 2014 assert is not optimized to nop in release builds
- * therefore this is correct. */
- assert("Can't do a scripterror for this deprecated message, so exit completely!");
+ FATAL_ERROR("Can't do a scripterror for this deprecated message, so exit completely!");
}
}