Commit 9330ef86 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: use Widthptr instead of Types[Tptr].Width

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: default avatarMatthew Dempsky <mdempsky@google.com>
parent 0ca8701e
......@@ -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"
}
}
......
......@@ -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
......
......@@ -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)
}
......
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