From 41f0744c4e601ec80e63cce15b6e50f02f6e4a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 11 Jul 2022 17:45:39 +0800 Subject: fix #1320 --- script/vm/runner.lua | 10 ++++++++-- script/vm/value.lua | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'script/vm') diff --git a/script/vm/runner.lua b/script/vm/runner.lua index dcfe83b2..36bab8bf 100644 --- a/script/vm/runner.lua +++ b/script/vm/runner.lua @@ -136,6 +136,7 @@ function mt:_lookIntoChild(action, topNode, outNode) if action.op.type == 'not' then outNode = outNode or topNode:copy() outNode, topNode = self:_lookIntoChild(action[1], topNode, outNode) + outNode = outNode:copy() end elseif action.type == 'binary' then if not action[1] or not action[2] then @@ -242,8 +243,13 @@ function mt:_lookIntoChild(action, topNode, outNode) mainNode = topNode:copy() end blockNode = self:_lookIntoBlock(action, blockNode:copy()) - if mainNode then - topNode = mainNode:merge(blockNode) + topNode = mainNode:merge(blockNode) + if action.filter then + -- look into filter again + guide.eachSource(action.filter, function (src) + self._mark[src] = nil + end) + blockNode, topNode = self:_lookIntoChild(action.filter, topNode:copy(), topNode:copy()) end elseif action.type == 'if' then local hasElse diff --git a/script/vm/value.lua b/script/vm/value.lua index bbae446c..7eab4a8e 100644 --- a/script/vm/value.lua +++ b/script/vm/value.lua @@ -23,7 +23,8 @@ function vm.testCondition(source) hasFalse = true end elseif n.type == 'global' and n.cate == 'type' then - if n.name == 'boolean' then + if n.name == 'boolean' + or n.name == 'unknown' then return nil end if n.name == 'false' -- cgit v1.2.3