diff mbox

libgo patch committed: Permit nil Func in Func.Name

Message ID CAOyqgcVB+6EtdWLG+f3W=hugo2F=6DyBOedraDOagc_H6yHB3g@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor May 5, 2015, 4:39 p.m. UTC
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

Comments

Andreas Schwab May 5, 2015, 5:35 p.m. UTC | #1
Ian Lance Taylor <iant@golang.org> writes:

> Committed to mainline and 4.9 branch.

What about the 5 branch?

Andreas.
Ian Lance Taylor May 5, 2015, 5:39 p.m. UTC | #2
On Tue, May 5, 2015 at 10:35 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Ian Lance Taylor <iant@golang.org> writes:
>
>> Committed to mainline and 4.9 branch.
>
> What about the 5 branch?

Oh yeah.  Thanks.  Committing to GCC 5 branch shortly, after tests complete.

Ian
diff mbox

Patch

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;
 }