]> Cypherpunks repositories - gostls13.git/commit
reflect: fix method indexing for non-ASCII exported methods
authorMatthew Dempsky <mdempsky@google.com>
Thu, 28 Sep 2017 03:14:54 +0000 (20:14 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 28 Sep 2017 18:06:53 +0000 (18:06 +0000)
commit6f1724ff415a85b3329806c0c9a3e5e46afac317
treec863fbd7f8525256b47846363d7e8651b12b7d2b
parentb3cae37464b6acb7a6676da667d292f353143954
reflect: fix method indexing for non-ASCII exported methods

Currently, methods are sorted by name. This happens to guarantee that
exported ASCII methods appear before non-exported ASCII methods, but
this breaks down when Unicode method names are considered.

Type.Method already accounts for this by always indexing into the
slice returned by exportedMethods. This CL makes Value.Method do the
same.

Fixes #22073.

Change-Id: I9bfc6bbfb7353e0bd3c439a15d1c3da60d16d209
Reviewed-on: https://go-review.googlesource.com/66770
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
src/reflect/all_test.go
src/reflect/value.go