summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/guide.lua8
-rw-r--r--test/definition/bug.lua60
2 files changed, 68 insertions, 0 deletions
diff --git a/script/core/guide.lua b/script/core/guide.lua
index 2c0bd025..71517cdc 100644
--- a/script/core/guide.lua
+++ b/script/core/guide.lua
@@ -2267,11 +2267,18 @@ function m.checkSameSimpleInCall(status, ref, start, pushQueue, mode)
end
end
m.cleanResults(objs)
+ if not status.share.callFuncMark then
+ status.share.callFuncMark = {}
+ end
local mark = {}
for _, obj in ipairs(objs) do
if mark[obj] then
goto CONTINUE
end
+ if status.share.callFuncMark[obj] then
+ goto CONTINUE
+ end
+ status.share.callFuncMark[obj] = true
local newStatus = m.status(status)
m.searchRefs(newStatus, obj, mode)
pushQueue(obj, start, true)
@@ -2280,6 +2287,7 @@ function m.checkSameSimpleInCall(status, ref, start, pushQueue, mode)
pushQueue(obj, start, true)
mark[obj] = true
end
+ status.share.callFuncMark[obj] = nil
::CONTINUE::
end
status.share.crossCallCount = status.share.crossCallCount - 1
diff --git a/test/definition/bug.lua b/test/definition/bug.lua
index 8c446123..d9ed7afc 100644
--- a/test/definition/bug.lua
+++ b/test/definition/bug.lua
@@ -169,3 +169,63 @@ end
local v
v.<?bar1?>
]]
+
+TEST [[
+local A, B
+
+function A:get1()
+ local <!a!> = B:get()
+ return <!a!>
+end
+
+function A:get2()
+ local <!a!> = B:get()
+ return <!a!>
+end
+
+function A:get3()
+ local <!a!> = B:get()
+ return <!a!>
+end
+
+function A:get4()
+ local <!a!> = B:get()
+ return <!a!>
+end
+
+function A:get5()
+ local <!a!> = B:get()
+ return <!a!>
+end
+
+function A:get6()
+ local <!a!> = B:get()
+ return <!a!>
+end
+
+function A:get7()
+ local <!a!> = B:get()
+ return <!a!>
+end
+
+function A:get8()
+ local <!a!> = B:get()
+ return <!a!>
+end
+
+function B:get()
+ local <!b!>
+ <!b!> = A:get1()
+ <!b!> = A:get2()
+ <!b!> = A:get3()
+ <!b!> = A:get4()
+ <!b!> = A:get5()
+ <!b!> = A:get6()
+ <!b!> = A:get7()
+ <!b!> = A:get8()
+ return <!b!>
+end
+
+local <!b!> = B:get()
+print(<?b?>)
+]]