From 3c0d3c6fbeea18f257102c62a01b036c7a5c5161 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 19 Jul 2019 13:14:06 -0300 Subject: 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). --- testes/db.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'testes') 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 end +-- hook table has weak keys +assert(getmetatable(debug.getregistry()._HOOKKEY).__mode == 'k') + + a = {}; L = nil local glob = 1 local oldglob = glob -- cgit v1.2.3-55-g6feb