Skip to content

Commit bb08494

Browse files
authored
Merge pull request #6726 from tautschnig/cleanup/symex-finding-symbols
goto-symex: do not rely on undocumented find_symbols(expr) behaviour
2 parents 31f1b59 + f21e9ed commit bb08494

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/goto-symex/goto_symex_state.cpp

+9-8
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Author: Daniel Kroening, [email protected]
2020
#include <util/c_types.h>
2121
#include <util/exception_utils.h>
2222
#include <util/expr_util.h>
23-
#include <util/find_symbols.h>
2423
#include <util/invariant.h>
2524
#include <util/std_expr.h>
2625

@@ -837,13 +836,15 @@ ssa_exprt goto_symex_statet::declare(ssa_exprt ssa, const namespacet &ns)
837836

838837
// L2 renaming
839838
const exprt fields = field_sensitivity.get_fields(ns, *this, ssa);
840-
for(const auto &l1_symbol : find_symbols(fields))
841-
{
842-
const ssa_exprt &field_ssa = to_ssa_expr(l1_symbol);
843-
const std::size_t field_generation = level2.increase_generation(
844-
l1_symbol.get_identifier(), field_ssa, fresh_l2_name_provider);
845-
CHECK_RETURN(field_generation == 1);
846-
}
839+
fields.visit_pre([this](const exprt &e) {
840+
if(auto l1_symbol = expr_try_dynamic_cast<symbol_exprt>(e))
841+
{
842+
const ssa_exprt &field_ssa = to_ssa_expr(*l1_symbol);
843+
const std::size_t field_generation = level2.increase_generation(
844+
l1_symbol->get_identifier(), field_ssa, fresh_l2_name_provider);
845+
CHECK_RETURN(field_generation == 1);
846+
}
847+
});
847848

848849
record_events.push(false);
849850
exprt expr_l2 = rename(std::move(ssa), ns).get();

0 commit comments

Comments
 (0)