Fix potentially unexpected behavior when using custom __pairs for metatables. Closes #1625.

This commit is contained in:
Florian Nücke 2016-01-31 14:45:48 +01:00
parent 0ba31b7be0
commit 45d8a20118

View File

@ -720,7 +720,7 @@ sandbox = {
-- which can lead to noticeable lag if the __gc function behaves badly.
local sbmt = {} -- sandboxed metatable. only for __gc stuff, so it's
-- kinda ok to have a shallow copy instead... meh.
for k, v in pairs(mt) do
for k, v in next, mt do
sbmt[k] = v
end
sbmt.mt = mt