From 1a4055a96248899d3145b5daa36968bc4ad41f3a Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 15 Aug 2019 18:25:22 +0300 Subject: [PATCH] compiler: fix codegen for OR, fixes failing TestLOR 0880e88fa5b1d258fb4e3aa08a97798c66e1f280 breaks it by introducing a new label that is not counted here. --- pkg/vm/compiler/codegen.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/vm/compiler/codegen.go b/pkg/vm/compiler/codegen.go index b819da95d..a0b3e852a 100644 --- a/pkg/vm/compiler/codegen.go +++ b/pkg/vm/compiler/codegen.go @@ -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