w.op(ir.OFALL)
w.pos(n.Pos())
- case ir.OBREAK, ir.OCONTINUE:
- w.op(op)
- w.pos(n.Pos())
- w.exprsOrNil(n.Left(), nil)
-
case ir.OEMPTY:
// nothing to emit
- case ir.OGOTO, ir.OLABEL:
+ case ir.OBREAK, ir.OCONTINUE, ir.OGOTO, ir.OLABEL:
w.op(op)
w.pos(n.Pos())
- w.string(n.Sym().Name)
+ label := ""
+ if sym := n.Sym(); sym != nil {
+ label = sym.Name
+ }
+ w.string(label)
default:
base.Fatalf("exporter: CANNOT EXPORT: %v\nPlease notify gri@\n", n.Op())
n := ir.NodAt(r.pos(), ir.OFALL, nil, nil)
return n
- case ir.OBREAK, ir.OCONTINUE:
- pos := r.pos()
- left, _ := r.exprsOrNil()
- if left != nil {
- left = NewName(left.Sym())
- }
- return ir.NodAt(pos, op, left, nil)
-
// case OEMPTY:
// unreachable - not emitted by exporter
- case ir.OGOTO, ir.OLABEL:
+ case ir.OBREAK, ir.OCONTINUE, ir.OGOTO, ir.OLABEL:
n := ir.NodAt(r.pos(), op, nil, nil)
- n.SetSym(lookup(r.string()))
+ if label := r.string(); label != "" {
+ n.SetSym(lookup(label))
+ }
return n
case ir.OEND: