aboutsummaryrefslogtreecommitdiff
path: root/src/compat.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/compat.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compat.cpp b/src/compat.cpp
index c332ddc..7e90142 100644
--- a/src/compat.cpp
+++ b/src/compat.cpp
@@ -120,9 +120,9 @@ int lua_getiuservalue(lua_State* const L_, StackIndex const idx_, UserValueIndex
120#endif// LUA_VERSION_NUM > 501 120#endif// LUA_VERSION_NUM > 501
121 STACK_CHECK(L_, 1); 121 STACK_CHECK(L_, 1);
122 int const _uvType{ lua_type(L_, -1) }; 122 int const _uvType{ lua_type(L_, -1) };
123 // under Lua 5.2, there is a single uservalue that is either nil or a table. 123 // under Lua 5.2 and 5.3, there is a single uservalue, that can be nil.
124 // If nil, don't transfer it, as it can cause issues when copying to a Keeper state because of nil sentinel conversion 124 // emulate 5.4 behavior by returning LUA_TNONE when that's the case
125 return (LUA_VERSION_NUM == 502 && _uvType == LUA_TNIL) ? LUA_TNONE : _uvType; 125 return (_uvType == LUA_TNIL) ? LUA_TNONE : _uvType;
126} 126}
127 127
128// ################################################################################################# 128// #################################################################################################