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

reflect: Value.IsNil panics for UnsafePointer #29381

Closed
alandonovan opened this issue Dec 21, 2018 · 1 comment
Closed

reflect: Value.IsNil panics for UnsafePointer #29381

alandonovan opened this issue Dec 21, 2018 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@alandonovan
Copy link
Contributor

https://play.golang.org/p/hNAU0a4jXJo

	var p unsafe.Pointer
	reflect.ValueOf(p).IsNil() // panic: "reflect: call of reflect.Value.IsNil on unsafe.Pointer Value"

This seems like an oversight, as it works for all other kinds of pointers, including func, interface, map, slice and chan.

@andybons andybons added the NeedsFix The path to resolution is known, but the work has not been done. label Dec 23, 2018
@andybons andybons added this to the Go1.12 milestone Dec 23, 2018
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/155797 mentions this issue: reflect: fix panic when Value.IsNil is called for UnsafePointer

@golang golang locked and limited conversation to collaborators Dec 24, 2019
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

3 participants