]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix type of OffPtr generated by ODOTPTR
authorMichael Munday <munday@ca.ibm.com>
Sun, 19 Feb 2017 17:10:18 +0000 (12:10 -0500)
committerMichael Munday <munday@ca.ibm.com>
Tue, 21 Feb 2017 19:28:38 +0000 (19:28 +0000)
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: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/ssa.go

index 4bcac5399492f836a49ac81338b7f5756d1234c7..11caacb9e94e055d1be717b5575ec2b8c73a5884 100644 (file)
@@ -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: