Eric Fiselier 1d6b5d3ed1 Fix strict-aliasing violation in typeinfo::hash_code()
Summary:
The current implementation of `hash_code()` for uniqued RTTI strings violates strict aliasing by dereferencing a type-punned pointer. Specifically it generates a `const char**` pointer from the address of the `__name` member before casting it to `const size_t*` and dereferencing it to get the hash. This is really just a complex and incorrect way of writing `reinterpret_cast<size_t>(__name)`.

This patch changes the conversion sequence so that it no longer contains UB.


Reviewers: howard.hinnant, mclow.lists

Subscribers: rjmccall, cfe-commits

Differential Revision: https://reviews.llvm.org/D24012

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283408 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 22:55:10 +00:00
..
2016-07-23 20:36:55 +00:00
2016-09-13 09:32:32 +00:00
2016-08-28 22:14:37 +00:00
2015-10-08 20:37:11 +00:00
2015-10-08 20:37:44 +00:00
2015-11-30 05:39:30 +00:00
2015-10-08 20:41:26 +00:00
2015-10-09 19:57:37 +00:00
2016-02-20 00:19:45 +00:00
2016-09-24 06:27:28 +00:00
2016-09-04 09:55:12 +00:00
2016-02-20 00:16:41 +00:00
2015-10-09 01:29:09 +00:00
2016-08-29 01:43:41 +00:00
2015-10-09 19:57:37 +00:00