1
0
mirror of https://github.com/golang/go synced 2024-09-30 04:34:33 -06:00

cmd/compile: fix misassumption about n.Left.Bounded()

n.Bounded() is overloaded for multiple meanings based on n.Op. We
can't safely use n.Left.Bounded() without checking n.Left.Op.

Change-Id: I71fe4faa24798dfe3a5705fa3419a35ef93b0ce2
Reviewed-on: https://go-review.googlesource.com/c/go/+/228677
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Matthew Dempsky 2020-04-16 16:49:10 -07:00 committed by Keith Randall
parent 7ea40f6594
commit 843453d09e

View File

@ -2549,7 +2549,7 @@ func (s *state) expr(n *Node) *ssa.Value {
return s.load(n.Type, addr)
case ODEREF:
p := s.exprPtr(n.Left, n.Left.Bounded(), n.Pos)
p := s.exprPtr(n.Left, false, n.Pos)
return s.load(n.Type, p)
case ODOT: