소스 검색

Make sure registering global values does not polute the execution stack

Ole 10 년 전
부모
커밋
bfe60d7a62
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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);
 }