aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2015-05-05 16:38:45 +0000
committerIan Lance Taylor <iant@google.com>2015-05-05 16:38:45 +0000
commitb09f90343f4ef9b3441f677cb13f709bce1aae3f (patch)
tree31bb7a6f95c56764965ce4849ed2e45ec043aa7e
parentfce35a393f3f06c3df6f97b20714433dd85a6bac (diff)
PR go/66016
runtime: Don't crash in Func.Name if the Func is nil. Related to Go issue 10696 git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@222815 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libgo/runtime/go-caller.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libgo/runtime/go-caller.c b/libgo/runtime/go-caller.c
index a3e04240d9c..f0ee4ebf02d 100644
--- a/libgo/runtime/go-caller.c
+++ b/libgo/runtime/go-caller.c
@@ -255,6 +255,8 @@ String runtime_funcname_go (Func *f)
String
runtime_funcname_go (Func *f)
{
+ if (f == NULL)
+ return runtime_gostringnocopy ((const byte *) "");
return f->name;
}