Parcourir la Source

Make sure registering global values does not polute the execution stack

Ole il y a 10 ans
Parent
commit
bfe60d7a62
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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
 void register_global(State* state, const char* name, T value) {
-	push(state, value);
+	assert(1 == push(state, value));
 	lua_setglobal(state, name);
 }