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: call of reflect.Value.Set on zero Value" instead of "nil panic" when accessing nil pointer #922

Open
zapateo opened this issue Nov 22, 2021 · 0 comments
Labels
bug Bug: something already implemented does not work as it should needsInvestigation Need to investigate

Comments

@zapateo
Copy link
Member

zapateo commented Nov 22, 2021

This code:

package main

func main() {
	var p *int
	*p = 1
}

should panic with:

panic: runtime error: invalid memory address or nil pointer dereference

But instead it panics the reflect packages:

panic: reflect: call of reflect.Value.Set on zero Value

Not sure if this is somehow related to #921.

@zapateo zapateo added bug Bug: something already implemented does not work as it should needsInvestigation Need to investigate labels Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug: something already implemented does not work as it should needsInvestigation Need to investigate
Projects
None yet
Development

No branches or pull requests

1 participant