Commit 10d718b9 authored by Michael Munday's avatar Michael Munday

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 <munday@ca.ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarDavid Chase <drchase@google.com>
parent ea020ff3
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment