Browse Source

Make sure registering global values does not polute the execution stack

Ole 10 years ago
parent
commit
bfe60d7a62
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/luwra/stack.hpp

+ 1 - 1
lib/luwra/stack.hpp

@@ -138,7 +138,7 @@ bool equal(State* state, int index1, int index2) {
  */
  */
 template <typename T> static inline
 template <typename T> static inline
 void register_global(State* state, const char* name, T value) {
 void register_global(State* state, const char* name, T value) {
-	push(state, value);
+	assert(1 == push(state, value));
 	lua_setglobal(state, name);
 	lua_setglobal(state, name);
 }
 }