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: default avatarMatthew Dempsky <mdempsky@google.com>
parent ad4b5f28
......@@ -793,13 +793,13 @@ func dcommontype(lsym *obj.LSym, ot int, t *types.Type) int {
}
sptrWeak := true
var sptr *types.Sym
var sptr *obj.LSym
if !t.IsPtr() || t.PtrBase != nil {
tptr := types.NewPtr(t)
if t.Sym != nil || methods(tptr) != nil {
sptrWeak = false
}
sptr = dtypesym(tptr)
sptr = dtypesym(tptr).Linksym()
}
gcsym, useGCProg, ptrdata := dgcsym(t)
......@@ -888,9 +888,9 @@ func dcommontype(lsym *obj.LSym, ot int, t *types.Type) int {
if sptr == nil {
ot = duint32(lsym, ot, 0)
} else if sptrWeak {
ot = dsymptrWeakOff(lsym, ot, sptr.Linksym())
ot = dsymptrWeakOff(lsym, ot, sptr)
} else {
ot = dsymptrOff(lsym, ot, sptr.Linksym(), 0)
ot = dsymptrOff(lsym, ot, sptr, 0)
}
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