diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-19 13:14:06 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-19 13:14:06 -0300 |
commit | 3c0d3c6fbeea18f257102c62a01b036c7a5c5161 (patch) | |
tree | 138a90dc27593aaf4e873ea8aca5b7d887084e1a /testes | |
parent | 440a5ee78c8592230780310c9c8d8c2ba1700cb1 (diff) | |
download | lua-3c0d3c6fbeea18f257102c62a01b036c7a5c5161.tar.gz lua-3c0d3c6fbeea18f257102c62a01b036c7a5c5161.tar.bz2 lua-3c0d3c6fbeea18f257102c62a01b036c7a5c5161.zip |
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).
Diffstat (limited to 'testes')
-rw-r--r-- | testes/db.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/testes/db.lua b/testes/db.lua index 3d94f776..a64a1130 100644 --- a/testes/db.lua +++ b/testes/db.lua | |||
@@ -255,6 +255,10 @@ do -- test hook presence in debug info | |||
255 | end | 255 | end |
256 | 256 | ||
257 | 257 | ||
258 | -- hook table has weak keys | ||
259 | assert(getmetatable(debug.getregistry()._HOOKKEY).__mode == 'k') | ||
260 | |||
261 | |||
258 | a = {}; L = nil | 262 | a = {}; L = nil |
259 | local glob = 1 | 263 | local glob = 1 |
260 | local oldglob = glob | 264 | local oldglob = glob |