The gc toolchain permits Func to be nil when calling the runtime.Func.Name method, returning an empty string. This patch changes libgo to do the same, rather than crashing. This is GCC PR 66016. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline and 4.9 branch.
Ian
diff -r f3c36747f019 libgo/runtime/go-caller.c --- a/libgo/runtime/go-caller.c Thu Apr 30 13:40:30 2015 -0700 +++ b/libgo/runtime/go-caller.c Tue May 05 07:12:06 2015 -0700 @@ -231,6 +231,8 @@ String runtime_funcname_go (Func *f) { + if (f == NULL) + return runtime_gostringnocopy ((const byte *) ""); return f->name; }