analyzer: fix hashing of bit_range_region::key_t [PR104452]
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 8 Feb 2022 21:37:08 +0000 (16:37 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 9 Feb 2022 02:27:12 +0000 (21:27 -0500)
commit391512ade5f6cda95456133296c8dcc42d5fbefd
tree64514e2a5ac45d9b7554fd992bc44edd263668de
parent53cac72cf0821217f99d0640ba72cc2999ec7dc0
analyzer: fix hashing of bit_range_region::key_t [PR104452]

gcc/analyzer/ChangeLog:
PR analyzer/104452
* region-model.cc (selftest::test_bit_range_regions): New.
(selftest::analyzer_region_model_cc_tests): Call it.
* region.h (bit_range_region::key_t::hash): Fix hashing of m_bits
to avoid using uninitialized data.

gcc/testsuite/ChangeLog:
PR analyzer/104452
* gcc.dg/analyzer/pr104452.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/analyzer/region-model.cc
gcc/analyzer/region.h
gcc/testsuite/gcc.dg/analyzer/pr104452.c [new file with mode: 0644]