From 05c07a8567a454038dd61a9eb4ba1c9ee9bbc1a0 Mon Sep 17 00:00:00 2001 From: Evgenii Date: Tue, 19 Feb 2019 16:14:55 +0300 Subject: [PATCH] compiler: fix argument handling for function arity >= 3 Imported from CityOfZion/neo-storm#61 PR. --- pkg/vm/compiler/codegen.go | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/pkg/vm/compiler/codegen.go b/pkg/vm/compiler/codegen.go index 70ba960e9..fbcfa5027 100644 --- a/pkg/vm/compiler/codegen.go +++ b/pkg/vm/compiler/codegen.go @@ -447,27 +447,6 @@ func (c *codegen) Visit(node ast.Node) ast.Visitor { emitInt(c.prog, 2) emitOpcode(c.prog, vm.XSWAP) } else { - half := int(numArgs / 2) - - for i := 0; i < half; i++ { - to := numArgs - 1 - i - - emitInt(c.prog, int64(to)) - emitOpcode(c.prog, vm.PICK) - - emitInt(c.prog, int64(i+1)) - emitOpcode(c.prog, vm.PICK) - - emitInt(c.prog, int64(to+2)) - emitOpcode(c.prog, vm.XSWAP) - emitOpcode(c.prog, vm.DROP) - - emitInt(c.prog, int64(i+1)) - emitOpcode(c.prog, vm.XSWAP) - emitOpcode(c.prog, vm.DROP) - } - } - if numArgs > 3 { for i := 1; i < numArgs; i++ { emitInt(c.prog, int64(i)) emitOpcode(c.prog, vm.ROLL)