From 843453d09e1a4dc9631056e9e3f4199f87106a48 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Thu, 16 Apr 2020 16:49:10 -0700 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall Reviewed-by: Josh Bleecher Snyder --- src/cmd/compile/internal/gc/ssa.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index bb401e805b..4829c5f5fc 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -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: