diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-04 01:41:24 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-04 01:41:24 +0000 |
commit | 7134be81f2a6d1d5775a659fb4f7de743bf516a0 (patch) | |
tree | 5f1c68fe8bf58b8564c9fcffd911fd3b50a73d9c /gcc/go | |
parent | d9936931d7e5c60514c401d0351e65a6d9404885 (diff) | |
download | gcc-7134be81f2a6d1d5775a659fb4f7de743bf516a0.tar.gz |
compiler, reflect: Fix hash codes of named types, fix PtrTo hash.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183889 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/gofrontend/types.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index 0bbe3c5b7ca..41bf491dff9 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -1658,7 +1658,12 @@ Type::type_descriptor_constructor(Gogo* gogo, int runtime_type_kind, ++p; go_assert(p->is_field_name("hash")); - mpz_set_ui(iv, this->hash_for_method(gogo)); + unsigned int h; + if (name != NULL) + h = name->hash_for_method(gogo); + else + h = this->hash_for_method(gogo); + mpz_set_ui(iv, h); vals->push_back(Expression::make_integer(&iv, p->type(), bloc)); ++p; |