diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-10-29 17:14:51 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-10-29 17:14:51 +0000 |
commit | 730f6d14253f7c8f44eff8c03beb5984e2f4c6cf (patch) | |
tree | 51c7bcf037fe05935e1479b498e56d84212089b1 /libgo/runtime/go-reflect-map.c | |
parent | 285b1f01acaf962e7a668aed7bab4d609a19fc3b (diff) | |
download | gcc-730f6d14253f7c8f44eff8c03beb5984e2f4c6cf.zip gcc-730f6d14253f7c8f44eff8c03beb5984e2f4c6cf.tar.gz gcc-730f6d14253f7c8f44eff8c03beb5984e2f4c6cf.tar.bz2 |
compiler, runtime: change type hash/equal to Go funcs
Change the type descriptor hash and equal functions from C code pointers
to Go func values. This permits them to be set to a Go function
closure. This is in preparation for the Go 1.5, so that we can use a
closure for the hash/equal functions returned by the new reflect.ArrayOf
function.
Reviewed-on: https://go-review.googlesource.com/16485
From-SVN: r229541
Diffstat (limited to 'libgo/runtime/go-reflect-map.c')
-rw-r--r-- | libgo/runtime/go-reflect-map.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libgo/runtime/go-reflect-map.c b/libgo/runtime/go-reflect-map.c index 58e1b34..36f3102 100644 --- a/libgo/runtime/go-reflect-map.c +++ b/libgo/runtime/go-reflect-map.c @@ -151,5 +151,6 @@ extern _Bool ismapkey (const struct __go_type_descriptor *) _Bool ismapkey (const struct __go_type_descriptor *typ) { - return typ != NULL && typ->__hashfn != __go_type_hash_error; + return (typ != NULL + && (void *) typ->__hashfn->fn != (void *) __go_type_hash_error); } |