Avoid using addresses of static variables as unique keys
The addresses of static variables may be different for different instances of Lua, making these instances incompatible if they use these addresses as unique keys in the registry (or other tables).
This commit is contained in:
1 parent
440a5ee78c
commit
3c0d3c6fbe
3 files changed
+17
-16
No files matched your search
@@ -255,6 +255,10 @@ do -- test hook presence in debug info
|
||||
end
|
||||
|
||||
|
||||
-- hook table has weak keys
|
||||
assert(getmetatable(debug.getregistry()._HOOKKEY).__mode == 'k')
|
||||
|
||||
|
||||
a = {}; L = nil
|
||||
local glob = 1
|
||||
local oldglob = glob
|
||||
|
||||
Reference in new issue
Block a user