We call (or will call) ResolveABIAlias in many places. Doing zero
symbol check everytime is annoying. Fold the condition into
ResolveABIAlias.
Change-Id: I10485fe83b9cce2d19b6bd17dc42176f72dae48b
Reviewed-on: https://go-review.googlesource.com/c/go/+/231046
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
off := r.Off()
siz := int32(r.Siz())
rs := r.Sym()
- if rs != 0 {
- rs = ldr.ResolveABIAlias(rs)
- }
+ rs = ldr.ResolveABIAlias(rs)
rt := r.Type()
if off < 0 || off+siz > int32(len(P)) {
rname := ""
// symbol. If the sym in question is not an alias, the sym itself is
// returned.
func (l *Loader) ResolveABIAlias(s Sym) Sym {
+ if s == 0 {
+ return 0
+ }
if l.SymType(s) != sym.SABIALIAS {
return s
}