mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-23 03:38:35 +00:00
swap arguments for functions with more than 3 arguments (CityOfZion/neo-storm#51)
Imported from CityOfZion/neo-storm (402ebb1d6226e2a30d8fdc19663227361cc72ca0).
This commit is contained in:
parent
74602b6143
commit
1883a11f44
1 changed files with 6 additions and 0 deletions
|
@ -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!
|
||||
|
|
Loading…
Reference in a new issue