debug/elf: Don't crash if line numbers are not available.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Mar 2012 05:33:10 +0000 (05:33 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Mar 2012 05:33:10 +0000 (05:33 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185124 138bc75d-0d04-0410-961f-82ee72b054a4

libgo/go/debug/elf/runtime.go

index 23e79bf..17cb6fb 100644 (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))