if Debug['v'] > 1 {
fmt.Fprintf(d.ctxt.Bso, "marktext %s\n", s.Name)
}
- for _, a := range s.Autom {
- d.mark(a.Gotype, s)
+ if s.Pcln != nil {
+ for _, a := range s.Pcln.Autom {
+ d.mark(a.Gotype, s)
+ }
}
+
}
if strings.HasPrefix(s.Name, "type.") && s.Name[5] != '.' {
return 0
}
// Raise limit to allow frame.
- limit = int(obj.StackLimit+s.Locals) + int(Ctxt.FixedFrameSize())
+ locals := int32(0)
+ if s.Pcln != nil {
+ locals = s.Pcln.Locals
+ }
+ limit = int(obj.StackLimit+locals) + int(Ctxt.FixedFrameSize())
}
// Walk through sp adjustments in function, consuming relocs.
for s := Ctxt.Textp; s != nil; s = s.Next {
put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), s.Gotype)
+ locals := int32(0)
+ if s.Pcln != nil {
+ locals = s.Pcln.Locals
+ }
// NOTE(ality): acid can't produce a stack trace without .frame symbols
- put(nil, ".frame", 'm', int64(s.Locals)+int64(SysArch.PtrSize), 0, 0, nil)
+ put(nil, ".frame", 'm', int64(locals)+int64(SysArch.PtrSize), 0, 0, nil)
- for _, a := range s.Autom {
+ if s.Pcln == nil {
+ continue
+ }
+ for _, a := range s.Pcln.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 {
}
if s.Type == obj.STEXT {
- s.Args = r.readInt32()
- s.Locals = r.readInt32()
+ s.Pcln = new(Pcln)
+ pc := s.Pcln
+
+ pc.Args = r.readInt32()
+ pc.Locals = r.readInt32()
if r.readUint8() != 0 {
s.Attr |= AttrNoSplit
}
s.Attr |= AttrReflectMethod
}
n := r.readInt()
- s.Autom = r.autom[:n:n]
+ pc.Autom = r.autom[:n:n]
if !isdup {
r.autom = r.autom[n:]
}
for i := 0; i < n; i++ {
- s.Autom[i] = Auto{
+ pc.Autom[i] = Auto{
Asym: r.readSymIndex(),
Aoffset: r.readInt32(),
Name: r.readInt16(),
}
}
- s.Pcln = new(Pcln)
- pc := s.Pcln
pc.Pcsp.P = r.readData()
pc.Pcfile.P = r.readData()
pc.Pcline.P = r.readData()
// args int32
// TODO: Move into funcinfo.
- off = int32(setuint32(Ctxt, ftab, int64(off), uint32(Ctxt.Cursym.Args)))
+ args := uint32(0)
+ if Ctxt.Cursym.Pcln != nil {
+ args = uint32(Ctxt.Cursym.Pcln.Args)
+ }
+ off = int32(setuint32(Ctxt, ftab, int64(off), args))
// frame int32
// This has been removed (it was never set quite correctly anyway).