3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

fix memory smash

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-02-27 11:49:25 -08:00
parent 3757f337e5
commit eb6d39ba46
6 changed files with 27 additions and 9 deletions

View file

@ -92,12 +92,12 @@ namespace simplex {
};
static const var_t null_var = UINT_MAX;
mutable manager m;
mutable eps_manager em;
mutable matrix M;
unsigned m_max_iterations;
volatile bool m_cancel;
var_heap m_to_patch;
mutable manager m;
mutable eps_manager em;
vector<var_info> m_vars;
svector<var_t> m_row2base;
bool m_bland;
@ -110,6 +110,7 @@ namespace simplex {
public:
simplex():
M(m),
m_max_iterations(UINT_MAX),
m_cancel(false),
m_to_patch(1024),

View file

@ -244,7 +244,10 @@ namespace simplex {
void simplex<Ext>::ensure_var(var_t v) {
while (v >= m_vars.size()) {
M.ensure_var(m_vars.size());
m_vars.push_back(var_info());
m_vars.push_back(var_info());
}
if (m_to_patch.get_bounds() <= v) {
m_to_patch.set_bounds(2*v+1);
}
}

View file

@ -129,7 +129,7 @@ namespace simplex {
void del_col_entry(unsigned idx);
};
manager m;
manager& m;
vector<_row> m_rows;
svector<unsigned> m_dead_rows; // rows to recycle
vector<column> m_columns; // per var
@ -143,7 +143,7 @@ namespace simplex {
public:
sparse_matrix() {}
sparse_matrix(manager& m): m(m) {}
~sparse_matrix();
class row {