From 4190a3e8ebd0ff1408fc47927394970de952f18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 29 Jul 2022 02:27:13 +0800 Subject: fix runtime errors reported by telemetry --- script/vm/function.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'script/vm/function.lua') diff --git a/script/vm/function.lua b/script/vm/function.lua index 0e04408c..f64b2262 100644 --- a/script/vm/function.lua +++ b/script/vm/function.lua @@ -148,7 +148,7 @@ end ---@return integer min ---@return number max function vm.countReturnsOfCall(func, args, mark) - local funcs = vm.getMatchedFunctions(func, args) + local funcs = vm.getMatchedFunctions(func, args, mark) ---@type integer? local min ---@type number? @@ -197,8 +197,9 @@ end ---@param func parser.object ---@param args parser.object[]? +---@param mark? table ---@return parser.object[] -function vm.getMatchedFunctions(func, args) +function vm.getMatchedFunctions(func, args, mark) local funcs = {} local node = vm.compileNode(func) for n in node:eachObject() do @@ -211,7 +212,7 @@ function vm.getMatchedFunctions(func, args) return funcs end - local amin, amax = vm.countList(args) + local amin, amax = vm.countList(args, mark) local matched = {} for _, n in ipairs(funcs) do -- cgit v1.2.3