From 1b85482ca7e44b8b60701184b6dd9e2f441db614 Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Sun, 10 Oct 2021 19:59:53 +0200 Subject: [PATCH] Fix vector indexing stack overflow --- vector.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vector.lua b/vector.lua index fef081a..0633607 100644 --- a/vector.lua +++ b/vector.lua @@ -1,5 +1,5 @@ -- Localize globals -local assert, math, pairs, rawset, setmetatable, unpack, vector = assert, math, pairs, rawset, setmetatable, unpack, vector +local assert, math, pairs, rawget, rawset, setmetatable, unpack, vector = assert, math, pairs, rawget, rawset, setmetatable, unpack, vector -- Set environment local _ENV = {} @@ -19,7 +19,7 @@ metatable = { __index = function(table, key) local index = index_aliases[key] if index ~= nil then - return table[index] + return rawget(table, index) end return _ENV[key] end,