From 2a89c31ba0a7a4b7b3547d26bb977d74632b222c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 21 Oct 2020 12:09:59 +0800 Subject: =?UTF-8?q?=E5=87=86=E5=A4=87=E6=A3=80=E6=9F=A5=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E6=80=A7=E8=83=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/parser/guide.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'script-beta/parser/guide.lua') diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua index ff20ed36..82617af5 100644 --- a/script-beta/parser/guide.lua +++ b/script-beta/parser/guide.lua @@ -18,6 +18,8 @@ local assert = assert local select = select local osClock = os.clock local DEVELOP = _G.DEVELOP +local log = log +local debug = debug _ENV = nil @@ -1394,6 +1396,9 @@ function m.checkSameSimpleByBindDocs(status, obj, start, queue, mode) if not obj.bindDocs then return end + if status.cache.searchingBindedDoc then + return + end local results = {} for _, doc in ipairs(obj.bindDocs) do if doc.type == 'doc.class' then @@ -1409,6 +1414,7 @@ function m.checkSameSimpleByBindDocs(status, obj, start, queue, mode) end local mark = {} local newStatus = m.status(status) + newStatus.cache.searchingBindedDoc = true for _, res in ipairs(results) do local source = m.getDocState(res) local ref = source.bind @@ -2181,8 +2187,12 @@ function m.searchRefs(status, obj, mode) if simple then m.searchSameFields(status, simple, mode) end - elseif m.debugMode then - error('stack overflow') + else + if m.debugMode then + error('status.depth overflow') + elseif DEVELOP then + log.warn(debug.traceback('status.depth overflow')) + end end status.depth = status.depth - 1 -- cgit v1.2.3