1
0
mirror of https://github.com/golang/go synced 2024-11-24 00:20:14 -07:00

[dev.ssa] cmd/compile: implement OIND

Change-Id: I15aee8095e6388822e2222f1995fe2278ac956ca
Reviewed-on: https://go-review.googlesource.com/12129
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Todd Neal 2015-07-13 21:22:16 -05:00 committed by Josh Bleecher Snyder
parent 4e204b42f5
commit b383de2ef9

View File

@ -719,6 +719,10 @@ func (s *state) addr(n *Node) *ssa.Value {
s.boundsCheck(i, len)
return s.newValue2(ssa.OpPtrIndex, Ptrto(n.Left.Type.Type), a, i)
}
case OIND:
p := s.expr(n.Left)
s.nilCheck(p)
return p
case ODOT:
p := s.addr(n.Left)
return s.newValue2(ssa.OpAdd, p.Type, p, s.constInt(s.config.Uintptr, n.Xoffset))