From 804e3e565e98e1ff3a22eb354a473225f6dc7351 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 23 Feb 2018 10:34:01 -0800 Subject: runtime: don't check for String/Error methods in printany They have either already been called by preprintpanics, or they can not be called safely because of the various conditions checked at the start of gopanic. Fixes #24059 Change-Id: I4a6233d12c9f7aaaee72f343257ea108bae79241 Reviewed-on: https://go-review.googlesource.com/96755 Reviewed-by: Austin Clements --- src/runtime/panic.go | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/runtime/panic.go') diff --git a/src/runtime/panic.go b/src/runtime/panic.go index 55ecb67654..dac63203fb 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -389,7 +389,6 @@ func Goexit() { // Call all Error and String methods before freezing the world. // Used when crashing with panicking. -// This must match types handled by printany. func preprintpanics(p *_panic) { defer func() { if recover() != nil { @@ -415,8 +414,6 @@ func printpanics(p *_panic) { print("\t") } print("panic: ") - // Because of preprintpanics, p.arg cannot be an error or - // stringer, so this won't call into user code. printany(p.arg) if p.recovered { print(" [recovered]") -- cgit v1.3-5-g9baa