From: Keith Randall Date: Sat, 12 Sep 2015 21:06:44 +0000 (-0700) Subject: [dev.ssa] cmd/compile/internal/ssa: OCHECKNIL is a statement, not an expression X-Git-Tag: go1.7beta1~1623^2^2~168 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=46ffb026b4ffc5a872a74a4ec3892b8ddad8bd8e;p=gostls13.git [dev.ssa] cmd/compile/internal/ssa: OCHECKNIL is a statement, not an expression Change-Id: I5a683f532a5a0b2bc862d80c871e8dc6721016fc Reviewed-on: https://go-review.googlesource.com/14534 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 7da49fc6f0..70350e0e2c 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -772,6 +772,10 @@ func (s *state) stmt(n *Node) { b.AddEdgeTo(bNext) s.startBlock(bNext) + case OCHECKNIL: + p := s.expr(n.Left) + s.nilCheck(p) + default: s.Unimplementedf("unhandled stmt %s", opnames[n.Op]) } @@ -1661,11 +1665,6 @@ func (s *state) expr(n *Node) *ssa.Value { case OADDR: return s.addr(n.Left) - case OCHECKNIL: - p := s.expr(n.Left) - s.nilCheck(p) - return p - case OINDREG: if int(n.Reg) != Thearch.REGSP { s.Unimplementedf("OINDREG of non-SP register %s in expr: %v", obj.Rconv(int(n.Reg)), n)