Index: trunk/src/lib/lua.cc
===================================================================
--- trunk/src/lib/lua.cc	(revision 171)
+++ trunk/src/lib/lua.cc	(revision 172)
@@ -45,4 +45,5 @@
 #	include <nv/lib/detail/lua_functions_compat.inc>
 #	undef NV_LUA_COMPAT_FUN
+int LUA_UPVALUEINDEX  = 0;
 int LUA_REGISTRYINDEX = 0;
 int LUA_VERSION_NUM   = 0;
@@ -266,4 +267,5 @@
 		NV_LUA_LOAD( luaL_getsubtable );
 
+		LUA_UPVALUEINDEX  = LUA_REGISTRYINDEX_52;
 		LUA_REGISTRYINDEX = LUA_REGISTRYINDEX_52;
 		LUA_VERSION_NUM   = 502;
@@ -292,4 +294,5 @@
 		NV_LUA_LOAD( lua_equal );
 		lua_compare       = lua_compare_51;
+		LUA_UPVALUEINDEX  = LUA_GLOBALSINDEX_51;
 		LUA_REGISTRYINDEX = LUA_REGISTRYINDEX_51;
 		LUA_VERSION_NUM   = 501;
