1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:41:21 -06:00

[dev.ssa] cmd/compile: fix type of nil ptr in check

Change-Id: If7a6ab6b1336dbacb006f562be7f153eb93e7253
Reviewed-on: https://go-review.googlesource.com/14025
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Todd Neal 2015-08-28 15:20:54 -05:00
parent f8093b8f24
commit 67ac8a3b22

View File

@ -2039,7 +2039,8 @@ func (s *state) lenMap(n *Node, x *ssa.Value) *ssa.Value {
// return *((*int)n)
// }
lenType := n.Type
cmp := s.newValue2(ssa.OpEqPtr, Types[TBOOL], x, s.zeroVal(lenType))
nilValue := s.newValue0(ssa.OpConstNil, Types[TUINTPTR])
cmp := s.newValue2(ssa.OpEqPtr, Types[TBOOL], x, nilValue)
b := s.endBlock()
b.Kind = ssa.BlockIf
b.Control = cmp