summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-02-26 21:37:38 +0100
committermadmaxoft <github@xoft.cz>2014-02-26 21:37:38 +0100
commitaaddc98b46c2b918e908287f53a137d2fb5cf697 (patch)
tree0525aeeacebed1d299725d7050546f654b790424 /src/Bindings/LuaState.cpp
parentAPIDump: Added Geometry file to project. (diff)
downloadcuberite-aaddc98b46c2b918e908287f53a137d2fb5cf697.tar
cuberite-aaddc98b46c2b918e908287f53a137d2fb5cf697.tar.gz
cuberite-aaddc98b46c2b918e908287f53a137d2fb5cf697.tar.bz2
cuberite-aaddc98b46c2b918e908287f53a137d2fb5cf697.tar.lz
cuberite-aaddc98b46c2b918e908287f53a137d2fb5cf697.tar.xz
cuberite-aaddc98b46c2b918e908287f53a137d2fb5cf697.tar.zst
cuberite-aaddc98b46c2b918e908287f53a137d2fb5cf697.zip
Diffstat (limited to 'src/Bindings/LuaState.cpp')
-rw-r--r--src/Bindings/LuaState.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index ca7f6b255..45a066efe 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -677,6 +677,11 @@ void cLuaState::Push(void * a_Ptr)
{
ASSERT(IsValid());
+ // Investigate the cause of this - what is the callstack?
+ LOGWARNING("Lua engine encountered an error - attempting to push a plain pointer");
+ LogStackTrace();
+ ASSERT(!"A plain pointer should never be pushed on Lua stack");
+
lua_pushnil(m_LuaState);
m_NumCurrentFunctionArgs += 1;
}
@@ -1265,6 +1270,8 @@ void cLuaState::LogStack(const char * a_Header)
void cLuaState::LogStack(lua_State * a_LuaState, const char * a_Header)
{
+ UNUSED(a_Header); // The param seems unused when compiling for release, so the compiler warns
+
LOGD((a_Header != NULL) ? a_Header : "Lua C API Stack contents:");
for (int i = lua_gettop(a_LuaState); i > 0; i--)
{