compiler: support nested slice element assignment

This commit is contained in:
Evgenii Stratonikov 2020-05-20 17:53:01 +03:00
parent 5b0e73ddf0
commit 8cf7871c26
2 changed files with 11 additions and 2 deletions

View file

@ -432,8 +432,7 @@ func (c *codegen) Visit(node ast.Node) ast.Visitor {
if !isAssignOp {
ast.Walk(c, n.Rhs[i])
}
name := t.X.(*ast.Ident).Name
c.emitLoadVar(name)
ast.Walk(c, t.X)
ast.Walk(c, t.Index)
emit.Opcode(c.prog.BinWriter, opcode.ROT)
emit.Opcode(c.prog.BinWriter, opcode.SETITEM)