debug/elf: Don't crash if line numbers are not available.

From-SVN: r185124
This commit is contained in:
Ian Lance Taylor 2012-03-09 05:33:10 +00:00
parent cc8459239b
commit 060b4284aa
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ func openExecutable() {
// and line number for a PC value.
func funcFileLine(pc uintptr, function *string, file *string, line *int) bool {
openExecutable()
if executable.dwarf == nil {
if executable == nil || executable.dwarf == nil {
return false
}
f, ln, err := executable.dwarf.FileLine(uint64(pc))