diff options
author | Wim <wim@42.be> | 2022-06-25 00:36:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-25 00:36:16 +0200 |
commit | 4649876956ab944d2a9ea8fc98c75dc8a9f5ef08 (patch) | |
tree | 0f32da8e492cabd8eca53de319e287e6c4791c5e /vendor/github.com/d5/tengo/v2/compiler.go | |
parent | 5604d140e3bbf5c8f6c414b1427145a0c4e36bb4 (diff) | |
download | matterbridge-msglm-4649876956ab944d2a9ea8fc98c75dc8a9f5ef08.tar.gz matterbridge-msglm-4649876956ab944d2a9ea8fc98c75dc8a9f5ef08.tar.bz2 matterbridge-msglm-4649876956ab944d2a9ea8fc98c75dc8a9f5ef08.zip |
Update dependencies (#1851)
Diffstat (limited to 'vendor/github.com/d5/tengo/v2/compiler.go')
-rw-r--r-- | vendor/github.com/d5/tengo/v2/compiler.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vendor/github.com/d5/tengo/v2/compiler.go b/vendor/github.com/d5/tengo/v2/compiler.go index e4e04303..6591603c 100644 --- a/vendor/github.com/d5/tengo/v2/compiler.go +++ b/vendor/github.com/d5/tengo/v2/compiler.go @@ -1220,14 +1220,14 @@ func (c *Compiler) optimizeFunc(node parser.Node) { iterateInstructions(c.scopes[c.scopeIndex].Instructions, func(pos int, opcode parser.Opcode, operands []int) bool { switch { + case dsts[pos]: + dstIdx++ + deadCode = false case opcode == parser.OpReturn: if deadCode { return true } deadCode = true - case dsts[pos]: - dstIdx++ - deadCode = false case deadCode: return true } @@ -1242,6 +1242,7 @@ func (c *Compiler) optimizeFunc(node parser.Node) { var appendReturn bool endPos := len(c.scopes[c.scopeIndex].Instructions) newEndPost := len(newInsts) + iterateInstructions(newInsts, func(pos int, opcode parser.Opcode, operands []int) bool { switch opcode { |