runtime: allow calling Func.Name on nil pointer
The Func type has allowed calling the Func.Name method on a nil pointer since Go1.2, where it returned an empty string. A regression caused by CL/37331 caused this behavior to change. This breaks code that lazily does runtime.FuncForPC(myPtr).Name() without first checking that myPtr is actually non-nil. Fixes #20872 Change-Id: Iae9a2ebabca5e9d1f5a2cdaf2f30e9c6198fec4f Reviewed-on: https://go-review.googlesource.com/47354Reviewed-by: Marvin Stenger <marvin.stenger94@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Showing
Please
register
or
sign in
to comment