if err != nil {
return nil, errMalformed
}
- // Adjust all frames by -1 (except the leaf) to land on top of
- // the call instruction.
- if len(locs) > 0 {
- addr--
- }
+ // Adjust all frames by -1 to land on the call instruction.
+ addr--
loc := locations[addr]
if loc == nil {
loc = &Location{
if s, addrs := extractHexAddresses(l); len(s) > 0 {
for _, addr := range addrs {
// Addresses from stack traces point to the next instruction after
- // each call. Adjust by -1 to land somewhere on the actual call
- // (except for the leaf, which is not a call).
- if len(sloc) > 0 {
- addr--
- }
+ // each call. Adjust by -1 to land somewhere on the actual call.
+ addr--
loc := locs[addr]
if locs[addr] == nil {
loc = &Location{
return nil, err
}
var sloc []*Location
- for i, addr := range addrs {
+ for _, addr := range addrs {
// Addresses from stack traces point to the next instruction after
- // each call. Adjust by -1 to land somewhere on the actual call
- // (except for the leaf, which is not a call).
- if i > 0 {
- addr--
- }
+ // each call. Adjust by -1 to land somewhere on the actual call.
+ addr--
loc := locs[addr]
if locs[addr] == nil {
loc = &Location{
return nil, err
}
var sloc []*Location
- for i, addr := range addrs {
+ for _, addr := range addrs {
// Addresses from stack traces point to the next instruction after
- // each call. Adjust by -1 to land somewhere on the actual call
- // (except for the leaf, which is not a call).
- if i > 0 {
- addr--
- }
+ // each call. Adjust by -1 to land somewhere on the actual call.
+ addr--
loc := locs[addr]
if locs[addr] == nil {
loc = &Location{
}
var sloc []*Location
- for i, addr := range addrs {
+ for _, addr := range addrs {
// Addresses from stack traces point to the next instruction after
- // each call. Adjust by -1 to land somewhere on the actual call
- // (except for the leaf, which is not a call).
- if i > 0 {
- addr--
- }
+ // each call. Adjust by -1 to land somewhere on the actual call.
+ addr--
loc := locs[addr]
if locs[addr] == nil {
loc = &Location{