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

factor cache pointers are invalid if the table is resized

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2022-01-26 16:18:18 -08:00
parent d1fcc41c7f
commit 0eaf5a8510
2 changed files with 7 additions and 8 deletions

View file

@ -890,12 +890,8 @@ namespace dd {
rest = p;
}
}
if (gc_generation != m_gc_generation) {
// Cache was reset while factoring (due to GC),
// which means the old entry has been removed and we need to insert it again.
auto* et = m_factor_cache.insert_if_not_there2({p.root, v, degree});
e = &et->get_data();
}
et = m_factor_cache.insert_if_not_there2({p.root, v, degree});
e = &et->get_data();
e->m_lc = lc.root;
e->m_rest = rest.root;
}