Skip to content

Do not store ref to goto_symext in symex_dereference_statet #4292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/goto-symex/symex_clean_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ process_array_expr(exprt &expr, bool do_simplify, const namespacet &ns)

void goto_symext::process_array_expr(statet &state, exprt &expr)
{
symex_dereference_statet symex_dereference_state(*this, state);
symex_dereference_statet symex_dereference_state(state, ns);

value_set_dereferencet dereference(
ns, state.symbol_table, symex_dereference_state, language_mode, false);
Expand Down
2 changes: 1 addition & 1 deletion src/goto-symex/symex_dereference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ void goto_symext::dereference_rec(exprt &expr, statet &state)
dereference_rec(tmp1, state);

// we need to set up some elaborate call-backs
symex_dereference_statet symex_dereference_state(*this, state);
symex_dereference_statet symex_dereference_state(state, ns);

value_set_dereferencet dereference(
ns,
Expand Down
16 changes: 7 additions & 9 deletions src/goto-symex/symex_dereference_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Author: Daniel Kroening, [email protected]
const symbolt *
symex_dereference_statet::get_or_create_failed_symbol(const exprt &expr)
{
const namespacet &ns=goto_symex.ns;

if(expr.id()==ID_symbol &&
expr.get_bool(ID_C_SSA_symbol))
{
Expand Down Expand Up @@ -86,24 +84,24 @@ void symex_dereference_statet::get_value_set(
const exprt &expr,
value_setst::valuest &value_set) const
{
state.value_set.get_value_set(expr, value_set, goto_symex.ns);
state.value_set.get_value_set(expr, value_set, ns);

#if 0
#if 0
std::cout << "**************************\n";
state.value_set.output(goto_symex.ns, std::cout);
std::cout << "**************************\n";
#endif
#endif

#if 0
#if 0
std::cout << "E: " << from_expr(goto_symex.ns, "", expr) << '\n';
#endif
#endif

#if 0
#if 0
std::cout << "**************************\n";
for(value_setst::valuest::const_iterator it=value_set.begin();
it!=value_set.end();
it++)
std::cout << from_expr(goto_symex.ns, "", *it) << '\n';
std::cout << "**************************\n";
#endif
#endif
}
8 changes: 3 additions & 5 deletions src/goto-symex/symex_dereference_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ class symex_dereference_statet:
public dereference_callbackt
{
public:
symex_dereference_statet(
const goto_symext &_goto_symex,
goto_symext::statet &_state)
: goto_symex(_goto_symex), state(_state)
symex_dereference_statet(goto_symext::statet &_state, const namespacet &ns)
: state(_state), ns(ns)
{
}

protected:
const goto_symext &goto_symex;
goto_symext::statet &state;
const namespacet &ns;

void get_value_set(const exprt &expr, value_setst::valuest &value_set)
const override;
Expand Down