Skip to content

reflect: panic on nil map access #8010

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

Closed
rsc opened this issue May 16, 2014 · 3 comments
Closed

reflect: panic on nil map access #8010

rsc opened this issue May 16, 2014 · 3 comments
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented May 16, 2014

var m map[int]int
reflect.ValueOf(m).MapIndex(ValueOf(42))
should return ValueOf(0), but instead it panics inside MapIndex calling
runtime.mapaccess.
Partial fix at https://golang.org/cl/91450048
@gopherbot
Copy link
Contributor

Comment 1:

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

@randall77
Copy link
Contributor

Comment 2:

It should return Value{}, not ValueOf(0).

@rsc
Copy link
Contributor Author

rsc commented May 19, 2014

Comment 3:

This issue was closed by revision d54b67d.

Status changed to Fixed.

@rsc rsc added fixed labels May 19, 2014
@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants