aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-19 13:14:06 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-19 13:14:06 -0300
commit3c0d3c6fbeea18f257102c62a01b036c7a5c5161 (patch)
tree138a90dc27593aaf4e873ea8aca5b7d887084e1a /testes
parent440a5ee78c8592230780310c9c8d8c2ba1700cb1 (diff)
downloadlua-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.lua4
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
255end 255end
256 256
257 257
258-- hook table has weak keys
259assert(getmetatable(debug.getregistry()._HOOKKEY).__mode == 'k')
260
261
258a = {}; L = nil 262a = {}; L = nil
259local glob = 1 263local glob = 1
260local oldglob = glob 264local oldglob = glob