if Debug['v'] > 1 {
fmt.Fprintf(&Bso, "marktext %s\n", s.Name)
}
- for a := s.Autom; a != nil; a = a.Link {
+ for _, a := range s.Autom {
mark1(a.Gotype, s)
}
}
}
}
- var a *Auto
var off int32
for s := Ctxt.Textp; s != nil; s = s.Next {
put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), s.Gotype)
// NOTE(ality): acid can't produce a stack trace without .frame symbols
put(nil, ".frame", 'm', int64(s.Locals)+int64(Thearch.Ptrsize), 0, 0, nil)
- for a = s.Autom; a != nil; a = a.Link {
+ for _, a := range s.Autom {
// Emit a or p according to actual offset, even if label is wrong.
// This avoids negative offsets, which cannot be encoded.
if a.Name != obj.A_AUTO && a.Name != obj.A_PARAM {
}
rdint(f) // v&1 is Leaf, currently unused
n := rdint(f)
- var a *Auto
+ s.Autom = make([]Auto, n)
for i := 0; i < n; i++ {
- a = new(Auto)
- a.Asym = rdsym(ctxt, f, pkg)
- a.Aoffset = rdint32(f)
- a.Name = rdint16(f)
- a.Gotype = rdsym(ctxt, f, pkg)
- a.Link = s.Autom
- s.Autom = a
+ s.Autom[i] = Auto{
+ Asym: rdsym(ctxt, f, pkg),
+ Aoffset: rdint32(f),
+ Name: rdint16(f),
+ Gotype: rdsym(ctxt, f, pkg),
+ }
}
s.Pcln = new(Pcln)