Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: panic(x) prints garbage if x is an integer other than 'int' #19658

Closed
alandonovan opened this issue Mar 22, 2017 · 2 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@alandonovan
Copy link
Contributor

The statement panic(int(8)) causes a panic whose message starts with panic: 8. However, a panic operand of any other integer type causes output of the form panic: (uint) (0x999a0,0x1040a040), which suppresses the most crucial piece of information, the numeric value 8.

It would be more helpful it if printed panic: uint: 8.

@ianlancetaylor
Copy link
Contributor

The code in question is https://golang.org/src/runtime/error.go#L77 .

@bradfitz bradfitz added this to the Go1.9Maybe milestone Mar 22, 2017
@gopherbot
Copy link

CL https://golang.org/cl/39650 mentions this issue.

@bradfitz bradfitz added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 9, 2017
lparth pushed a commit to lparth/go that referenced this issue Apr 13, 2017
Fixes golang#19658

Change-Id: I41e46073b75c7674e2ed9d6a90ece367ce92166b
Reviewed-on: https://go-review.googlesource.com/39650
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@golang golang locked and limited conversation to collaborators Apr 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants