compiler: fix codegen for OR, fixes failing TestLOR

0880e88fa5 breaks it by introducing a new label
that is not counted here.
This commit is contained in:
Roman Khimov 2019-08-15 18:25:22 +03:00
parent 810f096811
commit 1a4055a962

View file

@ -361,7 +361,7 @@ func (c *codegen) Visit(node ast.Node) ast.Visitor {
case token.LOR:
ast.Walk(c, n.X)
emitJmp(c.prog, vm.JMPIF, int16(len(c.l)-2))
emitJmp(c.prog, vm.JMPIF, int16(len(c.l) - 3))
ast.Walk(c, n.Y)
return nil