From 632f171ef0b7f4a6fc6d9c789430a7026335b03f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 12 Mar 2019 15:46:12 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=80=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/vm/vm.lua | 2 ++ server/test/references/init.lua | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua index f78f2690..ad25235c 100644 --- a/server/src/vm/vm.lua +++ b/server/src/vm/vm.lua @@ -54,10 +54,12 @@ function mt:buildTable(source) key:bindValue(value, 'set') if key.index then local index = self:getIndex(key) + key:set('parent', tbl) tbl:addInfo('set child', key, index) tbl:setChild(index, value) else if key.type == 'name' then + key:set('parent', tbl) key:set('table index', true) tbl:addInfo('set child', key, key[1]) tbl:setChild(key[1], value) diff --git a/server/test/references/init.lua b/server/test/references/init.lua index 2699fb70..59026031 100644 --- a/server/test/references/init.lua +++ b/server/test/references/init.lua @@ -71,3 +71,10 @@ local a = 1 local = 1 = ]] + +TEST [[ +local t = { + = 1 +} +print(t.) +]] -- cgit v1.2.3