]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: use Widthptr instead of Types[Tptr].Width
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 23 Mar 2017 18:21:42 +0000 (11:21 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 23 Mar 2017 21:51:16 +0000 (21:51 +0000)
Change-Id: I21e3abcfd1859f933f55fe875476dec07e43b038
Reviewed-on: https://go-review.googlesource.com/38466
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/dcl.go
src/cmd/compile/internal/gc/reflect.go
src/cmd/compile/internal/gc/subr.go

index aa1da36678d9ee97f01ebfb65c2e33f3c4fb6574..21a2b213259a17e5a3be417b51a0a9c6c72bef38 100644 (file)
@@ -1003,7 +1003,7 @@ func methodsym(nsym *Sym, t0 *Type, iface int) *Sym {
        suffix = ""
        if iface != 0 {
                dowidth(t0)
-               if t0.Width < Types[Tptr].Width {
+               if t0.Width < int64(Widthptr) {
                        suffix = "·i"
                }
        }
index 8be381443f12de69bde638beee788aec209d0470..326b15c48de38d048ac1fc91788a0815cc11bd23 100644 (file)
@@ -363,7 +363,7 @@ func methods(t *Type) []*Sig {
 
                if !sig.isym.Siggen() {
                        sig.isym.SetSiggen(true)
-                       if !eqtype(this, it) || this.Width < Types[Tptr].Width {
+                       if !eqtype(this, it) || this.Width < int64(Widthptr) {
                                compiling_wrappers = 1
                                genwrapper(it, f, sig.isym, 1)
                                compiling_wrappers = 0
index 234240983b301153358cb3741d5077a025136740..92a269f15d584a126cb272041a5c3730950e477e 100644 (file)
@@ -1701,13 +1701,13 @@ func genwrapper(rcvr *Type, method *Field, newnam *Sym, iface int) {
 
        t := nod(OTFUNC, nil, nil)
        l := []*Node{this}
-       if iface != 0 && rcvr.Width < Types[Tptr].Width {
+       if iface != 0 && rcvr.Width < int64(Widthptr) {
                // Building method for interface table and receiver
                // is smaller than the single pointer-sized word
                // that the interface call will pass in.
                // Add a dummy padding argument after the
                // receiver to make up the difference.
-               tpad := typArray(Types[TUINT8], Types[Tptr].Width-rcvr.Width)
+               tpad := typArray(Types[TUINT8], int64(Widthptr)-rcvr.Width)
                pad := nod(ODCLFIELD, newname(lookup(".pad")), typenod(tpad))
                l = append(l, pad)
        }