Commit ca95e4d1 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

bddprint: do not store a global shared_ptr to the bdd_dict

* src/twa/bddprint.cc: Do not store a global shared_ptr to the bdddict
used for printing (a simple pointer is enough), otherwise it risks being
the last shared_ptr to be destroyed, and it might be destroyed after the
unicity maps of the formulas.
parent c67540db
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
namespace spot namespace spot
{ {
/// Global dictionary used by print_handler() to lookup variables. /// Global dictionary used by print_handler() to lookup variables.
static bdd_dict_ptr dict; static bdd_dict* dict;
/// Global flag to enable Acc[x] output (instead of `x'). /// Global flag to enable Acc[x] output (instead of `x').
static bool want_acc; static bool want_acc;
...@@ -100,7 +100,7 @@ namespace spot ...@@ -100,7 +100,7 @@ namespace spot
std::ostream& std::ostream&
bdd_print_sat(std::ostream& os, const bdd_dict_ptr& d, bdd b) bdd_print_sat(std::ostream& os, const bdd_dict_ptr& d, bdd b)
{ {
dict = d; dict = d.get();
where = &os; where = &os;
want_acc = false; want_acc = false;
assert(bdd_satone(b) == b); assert(bdd_satone(b) == b);
...@@ -124,7 +124,7 @@ namespace spot ...@@ -124,7 +124,7 @@ namespace spot
std::ostream& std::ostream&
bdd_print_accset(std::ostream& os, const bdd_dict_ptr& d, bdd b) bdd_print_accset(std::ostream& os, const bdd_dict_ptr& d, bdd b)
{ {
dict = d; dict = d.get();
where = &os; where = &os;
want_acc = true; want_acc = true;
first_done = false; first_done = false;
...@@ -153,7 +153,7 @@ namespace spot ...@@ -153,7 +153,7 @@ namespace spot
std::ostream& std::ostream&
bdd_print_set(std::ostream& os, const bdd_dict_ptr& d, bdd b) bdd_print_set(std::ostream& os, const bdd_dict_ptr& d, bdd b)
{ {
dict = d; dict = d.get();
want_acc = true; want_acc = true;
bdd_strm_hook(print_handler); bdd_strm_hook(print_handler);
os << bddset << b; os << bddset << b;
...@@ -192,7 +192,7 @@ namespace spot ...@@ -192,7 +192,7 @@ namespace spot
std::ostream& std::ostream&
bdd_print_isop(std::ostream& os, const bdd_dict_ptr& d, bdd b) bdd_print_isop(std::ostream& os, const bdd_dict_ptr& d, bdd b)
{ {
dict = d; dict = d.get();
want_acc = true; want_acc = true;
minato_isop isop(b); minato_isop isop(b);
...@@ -201,7 +201,6 @@ namespace spot ...@@ -201,7 +201,6 @@ namespace spot
{ {
os << bdd_format_set(d, p); os << bdd_format_set(d, p);
} }
return os; return os;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment