3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-23 00:37:36 +00:00

Fix off-by-one vulnerabilities: use range-based for on goals; cache loop bound

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-19 22:37:22 +00:00
parent 093e227689
commit dbd7cd7414
6 changed files with 4 additions and 222 deletions

View file

@ -62,10 +62,9 @@ class ackr_bound_probe : public probe {
public:
result operator()(goal const & g) override {
proc p(g.m());
unsigned sz = g.size();
expr_fast_mark1 visited;
for (unsigned i = 0; i < sz; ++i) {
for_each_expr_core<proc, expr_fast_mark1, true, true>(p, visited, g.form(i));
for (auto [curr, dep, pr] : g) {
for_each_expr_core<proc, expr_fast_mark1, true, true>(p, visited, curr);
}
p.prune_non_select();
double total = ackr_helper::calculate_lemma_bound(p.m_fun2terms, p.m_sel2terms);