diff options
author | Markus Böck <markus.boeck02@gmail.com> | 2020-10-27 09:53:08 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2020-10-27 09:53:08 -0400 |
commit | 942086bf73ee2ba6cfd7fdacc552940048437a6e (patch) | |
tree | f5a6c0bf5eda3cb8b80fc5149387c4c6c4368d41 /gcc/analyzer/store.h | |
parent | bf1b5dae440de8884f66d0dbe9ad539102682e00 (diff) | |
download | gcc-942086bf73ee2ba6cfd7fdacc552940048437a6e.zip gcc-942086bf73ee2ba6cfd7fdacc552940048437a6e.tar.gz gcc-942086bf73ee2ba6cfd7fdacc552940048437a6e.tar.bz2 |
analyzer: Change cast from long to intptr_t [PR96608]
Casting to intptr_t states the intent of an integer to pointer cast
more clearly and ensures that the cast causes no loss of precision on
any platforms. LLP64 platforms eg. have a long value of 4 bytes and
pointer values of 8 bytes which may even cause compiler errors.
gcc/analyzer/ChangeLog:
PR analyzer/96608
* store.h (hash): Cast to intptr_t instead of long
Diffstat (limited to 'gcc/analyzer/store.h')
-rw-r--r-- | gcc/analyzer/store.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/analyzer/store.h b/gcc/analyzer/store.h index 466c183..8054b34 100644 --- a/gcc/analyzer/store.h +++ b/gcc/analyzer/store.h @@ -271,7 +271,7 @@ public: hashval_t hash () const { - return (binding_key::impl_hash () ^ (long)m_region); + return (binding_key::impl_hash () ^ (intptr_t)m_region); } bool operator== (const symbolic_binding &other) const { |