aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvalid-ptr <konstantin.matveyev@eligovision.ru>2021-02-24 19:04:23 +0300
committerKonstantin S. Matveyev <kos@eligovision.ru>2021-02-24 19:13:22 +0300
commita9daf44c335351366b96f2971b2f8acc227430b1 (patch)
tree160354cab3a9856ead9e74df24bcb4f445caaa0a
parent1d255d1d5f55584626ae247610f379ccdb8f2ec5 (diff)
downloadlanes-a9daf44c335351366b96f2971b2f8acc227430b1.tar.gz
lanes-a9daf44c335351366b96f2971b2f8acc227430b1.tar.bz2
lanes-a9daf44c335351366b96f2971b2f8acc227430b1.zip
Compat lua_setiuservalue fixed for Lua 5.1 and LuaJIT
Diffstat (limited to '')
-rw-r--r--src/compat.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compat.c b/src/compat.c
index bccd05f..d9bc3dd 100644
--- a/src/compat.c
+++ b/src/compat.c
@@ -78,11 +78,16 @@ int lua_getiuservalue( lua_State* L, int idx, int n)
78 78
79int lua_setiuservalue( lua_State* L, int idx, int n) 79int lua_setiuservalue( lua_State* L, int idx, int n)
80{ 80{
81 if( n > 1) 81 if( n > 1
82#if LUA_VERSION_NUM == 501
83 || lua_type( L, -1) != LUA_TTABLE
84#endif
85 )
82 { 86 {
83 lua_pop( L, 1); 87 lua_pop( L, 1);
84 return 0; 88 return 0;
85 } 89 }
90
86 (void) lua_setuservalue( L, idx); 91 (void) lua_setuservalue( L, idx);
87 return 1; // I guess anything non-0 is ok 92 return 1; // I guess anything non-0 is ok
88} 93}