3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-19 07:06:28 +00:00

Replace inline depth_guard struct with on_scope_exit in datatype_factory.cpp

This commit is contained in:
copilot-swe-agent[bot] 2026-06-18 20:01:17 +00:00 committed by GitHub
parent 097372c779
commit a90901b7c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -141,7 +141,8 @@ expr * datatype_factory::get_fresh_value(sort * s) {
return m_model.get_fresh_value(s);
if (m_fresh_depth >= m_max_fresh_depth)
return get_last_fresh_value(s);
struct depth_guard { unsigned& d; depth_guard(unsigned& d) : d(d) { ++d; } ~depth_guard() { --d; } } _dg(m_fresh_depth);
++m_fresh_depth;
on_scope_exit _dg([&]() { --m_fresh_depth; });
TRACE(datatype, tout << "generating fresh value for: " << s->get_name() << "\n";);
auto& [set, values] = get_value_set(s);
// Approach 0)