Commit 0d1e903c authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: unify a Linksym call in dcommontype

Passes toolstash-check.

Change-Id: I9940909949da58e780696e6de0c21f95be7a8816
Reviewed-on: https://go-review.googlesource.com/41407
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
parent ad4b5f28
...@@ -793,13 +793,13 @@ func dcommontype(lsym *obj.LSym, ot int, t *types.Type) int { ...@@ -793,13 +793,13 @@ func dcommontype(lsym *obj.LSym, ot int, t *types.Type) int {
} }
sptrWeak := true sptrWeak := true
var sptr *types.Sym var sptr *obj.LSym
if !t.IsPtr() || t.PtrBase != nil { if !t.IsPtr() || t.PtrBase != nil {
tptr := types.NewPtr(t) tptr := types.NewPtr(t)
if t.Sym != nil || methods(tptr) != nil { if t.Sym != nil || methods(tptr) != nil {
sptrWeak = false sptrWeak = false
} }
sptr = dtypesym(tptr) sptr = dtypesym(tptr).Linksym()
} }
gcsym, useGCProg, ptrdata := dgcsym(t) gcsym, useGCProg, ptrdata := dgcsym(t)
...@@ -888,9 +888,9 @@ func dcommontype(lsym *obj.LSym, ot int, t *types.Type) int { ...@@ -888,9 +888,9 @@ func dcommontype(lsym *obj.LSym, ot int, t *types.Type) int {
if sptr == nil { if sptr == nil {
ot = duint32(lsym, ot, 0) ot = duint32(lsym, ot, 0)
} else if sptrWeak { } else if sptrWeak {
ot = dsymptrWeakOff(lsym, ot, sptr.Linksym()) ot = dsymptrWeakOff(lsym, ot, sptr)
} else { } else {
ot = dsymptrOff(lsym, ot, sptr.Linksym(), 0) ot = dsymptrOff(lsym, ot, sptr, 0)
} }
return ot return ot
......
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