mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
add missing locks around mpz operations that access object allocator. Use internal skolem constant for theory assumption to hide it from models
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
0ddbd32a42
commit
a0efdc21c3
|
@ -7364,7 +7364,7 @@ namespace smt {
|
||||||
const char* strOverlap = "!!TheoryStrOverlapAssumption!!";
|
const char* strOverlap = "!!TheoryStrOverlapAssumption!!";
|
||||||
seq_util m_sequtil(get_manager());
|
seq_util m_sequtil(get_manager());
|
||||||
sort * s = get_manager().mk_bool_sort();
|
sort * s = get_manager().mk_bool_sort();
|
||||||
m_theoryStrOverlapAssumption_term = expr_ref(get_manager().mk_fresh_const(strOverlap, s), get_manager());
|
m_theoryStrOverlapAssumption_term = expr_ref(mk_fresh_const(strOverlap, s), get_manager());
|
||||||
assumptions.push_back(get_manager().mk_not(m_theoryStrOverlapAssumption_term));
|
assumptions.push_back(get_manager().mk_not(m_theoryStrOverlapAssumption_term));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9239,7 +9239,7 @@ namespace smt {
|
||||||
);
|
);
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
ptr_vector<expr> orList;
|
ptr_vector<expr> orList;
|
||||||
ptr_vector<expr> andList;
|
ptr_vector<expr> andList;
|
||||||
|
|
||||||
|
|
|
@ -497,7 +497,9 @@ public:
|
||||||
STRACE("mpz", tout << "[mpz] 0 - " << to_string(a) << " == ";);
|
STRACE("mpz", tout << "[mpz] 0 - " << to_string(a) << " == ";);
|
||||||
if (is_small(a) && a.m_val == INT_MIN) {
|
if (is_small(a) && a.m_val == INT_MIN) {
|
||||||
// neg(INT_MIN) is not a small int
|
// neg(INT_MIN) is not a small int
|
||||||
|
MPZ_BEGIN_CRITICAL();
|
||||||
set_big_i64(a, - static_cast<long long>(INT_MIN));
|
set_big_i64(a, - static_cast<long long>(INT_MIN));
|
||||||
|
MPZ_END_CRITICAL();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifndef _MP_GMP
|
#ifndef _MP_GMP
|
||||||
|
@ -518,7 +520,9 @@ public:
|
||||||
if (a.m_val < 0) {
|
if (a.m_val < 0) {
|
||||||
if (a.m_val == INT_MIN) {
|
if (a.m_val == INT_MIN) {
|
||||||
// abs(INT_MIN) is not a small int
|
// abs(INT_MIN) is not a small int
|
||||||
|
MPZ_BEGIN_CRITICAL();
|
||||||
set_big_i64(a, - static_cast<long long>(INT_MIN));
|
set_big_i64(a, - static_cast<long long>(INT_MIN));
|
||||||
|
MPZ_END_CRITICAL();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
a.m_val = -a.m_val;
|
a.m_val = -a.m_val;
|
||||||
|
|
|
@ -68,6 +68,8 @@ void small_object_allocator::reset() {
|
||||||
|
|
||||||
#define MASK ((1 << PTR_ALIGNMENT) - 1)
|
#define MASK ((1 << PTR_ALIGNMENT) - 1)
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
void small_object_allocator::deallocate(size_t size, void * p) {
|
void small_object_allocator::deallocate(size_t size, void * p) {
|
||||||
if (size == 0) return;
|
if (size == 0) return;
|
||||||
|
|
||||||
|
@ -92,6 +94,7 @@ void small_object_allocator::deallocate(size_t size, void * p) {
|
||||||
m_free_list[slot_id] = p;
|
m_free_list[slot_id] = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void * small_object_allocator::allocate(size_t size) {
|
void * small_object_allocator::allocate(size_t size) {
|
||||||
if (size == 0) return 0;
|
if (size == 0) return 0;
|
||||||
|
|
||||||
|
@ -100,8 +103,9 @@ void * small_object_allocator::allocate(size_t size) {
|
||||||
return memory::allocate(size);
|
return memory::allocate(size);
|
||||||
#endif
|
#endif
|
||||||
m_alloc_size += size;
|
m_alloc_size += size;
|
||||||
if (size >= SMALL_OBJ_SIZE - (1 << PTR_ALIGNMENT))
|
if (size >= SMALL_OBJ_SIZE - (1 << PTR_ALIGNMENT)) {
|
||||||
return memory::allocate(size);
|
return memory::allocate(size);
|
||||||
|
}
|
||||||
#ifdef Z3DEBUG
|
#ifdef Z3DEBUG
|
||||||
size_t osize = size;
|
size_t osize = size;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue