From 10d718b9839dc7b1c55761d6c9f3001fac498cd0 Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Sun, 19 Feb 2017 12:10:18 -0500 Subject: [PATCH] cmd/compile: fix type of OffPtr generated by ODOTPTR The type of the OffPtr should be consistent with the type of the following load. Before this CL it was typed as a pointer to the struct. Fixes #19164. Change-Id: Ibcdec4411c6f719702f76f8dba3cce8691bfbe0c Reviewed-on: https://go-review.googlesource.com/37254 Run-TryBot: Michael Munday TryBot-Result: Gobot Gobot Reviewed-by: David Chase --- 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 4bcac53994..11caacb9e9 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -1952,7 +1952,7 @@ func (s *state) expr(n *Node) *ssa.Value { case ODOTPTR: p := s.exprPtr(n.Left, false, n.Pos) - p = s.newValue1I(ssa.OpOffPtr, p.Type, n.Xoffset, p) + p = s.newValue1I(ssa.OpOffPtr, ptrto(n.Type), n.Xoffset, p) return s.newValue2(ssa.OpLoad, n.Type, p, s.mem()) case OINDEX: -- 2.50.0