]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR go/66016 (Accessing nil Func's name results in crash)
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 5 May 2015 16:38:45 +0000 (16:38 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 5 May 2015 16:38:45 +0000 (16:38 +0000)
PR go/66016
runtime: Don't crash in Func.Name if the Func is nil.

Related to Go issue 10696

From-SVN: r222815

libgo/runtime/go-caller.c

index a3e04240d9ce508cadb1f2a326e6e22193f78816..f0ee4ebf02d92fbeb3e5da377bed907ffae8308c 100644 (file)
@@ -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;
 }