This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgo patch committed: Don't crash if can't get line numbers


This patch to libgo avoids crashing the program if for some reason we
can't get line number information.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r 27261b2b1db7 libgo/go/debug/elf/runtime.go
--- a/libgo/go/debug/elf/runtime.go	Thu Mar 08 15:28:14 2012 -0800
+++ b/libgo/go/debug/elf/runtime.go	Thu Mar 08 21:28:13 2012 -0800
@@ -129,7 +129,7 @@
 // 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))

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]