summaryrefslogtreecommitdiff
path: root/script/vm/compiler.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/vm/compiler.lua')
-rw-r--r--script/vm/compiler.lua17
1 files changed, 11 insertions, 6 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index ff1e3a15..6c5f2b17 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -1290,10 +1290,8 @@ local compilerSwitch = util.switch()
end
return vm.getNode(src)
elseif src.type == 'getlocal' then
- if bindAs(src) then
- return
- end
- vm.setNode(src, node, true)
+ src._runnerNode = node
+ vm.removeNode(src)
end
end)
@@ -1316,7 +1314,12 @@ local compilerSwitch = util.switch()
if bindAs(source) then
return
end
- vm.compileNode(source.node)
+ if not source._runnerNode then
+ vm.compileNode(source.node)
+ end
+ if source._runnerNode then
+ vm.setNode(source, source._runnerNode)
+ end
end)
: case 'setfield'
: case 'setmethod'
@@ -1850,7 +1853,9 @@ local function compileByCall(source)
end
end
if needRemove then
- myNode:removeNode(needRemove)
+ local newNode = myNode:copy()
+ newNode:removeNode(needRemove)
+ vm.setNode(source, newNode, true)
end
end