Commit 67ac8a3b authored by Todd Neal's avatar Todd Neal

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

Change-Id: If7a6ab6b1336dbacb006f562be7f153eb93e7253
Reviewed-on: https://go-review.googlesource.com/14025Reviewed-by: default avatarKeith Randall <khr@golang.org>
parent f8093b8f
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment