mirror of
https://github.com/Z3Prover/z3
synced 2025-07-26 22:17:54 +00:00
clear memory on allocation to avoid msan warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
7e452254c3
commit
cdf3c48349
2 changed files with 2 additions and 0 deletions
|
@ -44,6 +44,7 @@ void tbv_manager::reset() {
|
||||||
}
|
}
|
||||||
tbv* tbv_manager::allocate() {
|
tbv* tbv_manager::allocate() {
|
||||||
tbv* r = static_cast<tbv*>(m.allocate());
|
tbv* r = static_cast<tbv*>(m.allocate());
|
||||||
|
m.reset(*r);
|
||||||
DEBUG_CODE(
|
DEBUG_CODE(
|
||||||
if (s_debug_alloc) {
|
if (s_debug_alloc) {
|
||||||
TRACE("doc", tout << allocated_tbvs.size() << " " << r << "\n";);
|
TRACE("doc", tout << allocated_tbvs.size() << " " << r << "\n";);
|
||||||
|
|
|
@ -48,6 +48,7 @@ fixed_bit_vector_manager::fixed_bit_vector_manager(unsigned num_bits):
|
||||||
m_num_bytes = m_num_words * sizeof(unsigned);
|
m_num_bytes = m_num_words * sizeof(unsigned);
|
||||||
unsigned bit_rest = m_num_bits % 32;
|
unsigned bit_rest = m_num_bits % 32;
|
||||||
m_mask = (1U << bit_rest) - 1;
|
m_mask = (1U << bit_rest) - 1;
|
||||||
|
memset(&m_0, 0, sizeof(m_0));
|
||||||
if (m_mask == 0) m_mask = UINT_MAX;
|
if (m_mask == 0) m_mask = UINT_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue