compiler: push Null item for nil values

This commit is contained in:
Evgenii Stratonikov 2020-06-17 11:21:37 +03:00
parent a4e4439967
commit afd8f3b87a

View file

@ -586,6 +586,8 @@ func (c *codegen) Visit(node ast.Node) ast.Visitor {
case *ast.Ident:
if tv := c.typeAndValueOf(n); tv.Value != nil {
c.emitLoadConst(tv)
} else if n.Name == "nil" {
emit.Opcode(c.prog.BinWriter, opcode.PUSHNULL)
} else {
c.emitLoadVar(n.Name)
}