From bd754b0691994a9868de83c145ef234bb659e13c 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, 15 Dec 2020 18:03:11 +0800 Subject: fix #294 --- script/parser/guide.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'script') diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 40404f70..a6b11744 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -2312,9 +2312,13 @@ function m.pushResult(status, mode, ref, simple) or ref.type == 'getmethod' then results[#results+1] = ref elseif ref.type == 'setindex' - or ref.type == 'getindex' or ref.type == 'tableindex' then results[#results+1] = ref + elseif ref.type == 'getindex' then + -- do not trust `t[1]` + if ref.index.type == 'string' then + results[#results+1] = ref + end elseif ref.type == 'setglobal' or ref.type == 'getglobal' then results[#results+1] = ref @@ -2440,12 +2444,17 @@ function m.searchSameFields(status, simple, mode) } end local max = 0 - local lock = {} + local locks = {} for i = 1, 1e6 do local data = queue[i] if not data then return end + local lock = locks[data.start] + if not lock then + lock = {} + locks[data.start] = lock + end if not lock[data.obj] then lock[data.obj] = true max = max + 1 -- cgit v1.2.3