mirror of
https://github.com/Z3Prover/z3
synced 2025-06-27 08:28:44 +00:00
Fix memory smash on double free of clauses
Signed-off-by: nikolajbjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
a96a9a076d
commit
0d9f949ab2
6 changed files with 32 additions and 1 deletions
|
@ -207,6 +207,24 @@ namespace sat {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool integrity_checker::check_disjoint_clauses() const {
|
||||
uint_set ids;
|
||||
clause_vector::const_iterator it = s.m_clauses.begin();
|
||||
clause_vector::const_iterator end = s.m_clauses.end();
|
||||
for (; it != end; ++it) {
|
||||
ids.insert((*it)->id());
|
||||
}
|
||||
it = s.m_learned.begin();
|
||||
end = s.m_learned.end();
|
||||
for (; it != end; ++it) {
|
||||
if (ids.contains((*it)->id())) {
|
||||
TRACE("sat", tout << "Repeated clause: " << (*it)->id() << "\n";);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool integrity_checker::operator()() const {
|
||||
if (s.inconsistent())
|
||||
|
@ -216,6 +234,7 @@ namespace sat {
|
|||
SASSERT(check_watches());
|
||||
SASSERT(check_bool_vars());
|
||||
SASSERT(check_reinit_stack());
|
||||
SASSERT(check_disjoint_clauses());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue