From: Michael Munday Date: Sun, 19 Feb 2017 17:10:18 +0000 (-0500) Subject: cmd/compile: fix type of OffPtr generated by ODOTPTR X-Git-Tag: go1.9beta1~1478 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=10d718b9839dc7b1c55761d6c9f3001fac498cd0;p=gostls13.git 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 --- 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: