Skip to content

Commit

Permalink
Handle some dwarf corner cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
randall77 committed Dec 22, 2017
1 parent 8273ee2 commit e033642
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gocore/dwarf.go
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ func (p *Process) readGlobals() {
if !ok {
continue // Sometimes an int64?
}
if loc[0] != _DW_OP_addr {
if len(loc) == 0 || loc[0] != _DW_OP_addr {
continue
}
var a core.Address
Expand Down Expand Up @@ -909,6 +909,9 @@ func (p *Process) readStackVars() {
if len(loc) != 0 {
continue
}
if e.AttrField(dwarf.AttrType) == nil {
continue
}
dt, err := d.Type(e.AttrField(dwarf.AttrType).Val.(dwarf.Offset))
if err != nil {
panic(err)
Expand Down

0 comments on commit e033642

Please sign in to comment.