swap arguments for functions with more than 3 arguments (CityOfZion/neo-storm#51)

Imported from CityOfZion/neo-storm (402ebb1d6226e2a30d8fdc19663227361cc72ca0).
This commit is contained in:
Evgenii Stratonikov 2018-10-29 18:37:08 +03:00 committed by Roman Khimov
parent 74602b6143
commit 1883a11f44

View file

@ -466,6 +466,12 @@ func (c *codegen) Visit(node ast.Node) ast.Visitor {
emitOpcode(c.prog, vm.DROP)
}
}
if numArgs > 3 {
for i := 1; i < numArgs; i++ {
emitInt(c.prog, int64(i))
emitOpcode(c.prog, vm.ROLL)
}
}
}
// Check builtin first to avoid nil pointer on funcScope!