@@ -20,7 +20,6 @@ Author: Daniel Kroening, kroening@kroening.com
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