summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/core/vm.lua1
-rw-r--r--server/test/diagnostics/init.lua8
2 files changed, 9 insertions, 0 deletions
diff --git a/server/src/core/vm.lua b/server/src/core/vm.lua
index e649ecc7..8359c470 100644
--- a/server/src/core/vm.lua
+++ b/server/src/core/vm.lua
@@ -288,6 +288,7 @@ function mt:runFunction(func)
self.chunk:cut 'locals'
self.chunk.func = func
+ self.scope:cut 'locals'
for name, loc in pairs(func.upvalues) do
self.scope.locals[name] = loc
end
diff --git a/server/test/diagnostics/init.lua b/server/test/diagnostics/init.lua
index acaf3249..9df92961 100644
--- a/server/test/diagnostics/init.lua
+++ b/server/test/diagnostics/init.lua
@@ -158,3 +158,11 @@ local function f(<!self!>)
end
f()
]]
+
+TEST [[
+local function f(var)
+ print(var)
+end
+local var
+f(var)
+]]