This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
libgo patch committed: Don't crash if can't get line numbers
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Thu, 08 Mar 2012 21:32:12 -0800
- Subject: 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))