@@ -15,16 +15,30 @@ bvt boolbvt::convert_let(const let_exprt &expr)
15
15
{
16
16
const bvt value_bv=convert_bv (expr.value ());
17
17
18
- // We expect the identifiers of the bound symbols to be unique,
19
- // and thus, these can go straight into the symbol to literal map.
20
- // This property also allows us to cache any subexpressions.
21
- const irep_idt &id=expr.symbol ().get_identifier ();
18
+ const irep_idt &id = expr.symbol ().get_identifier ();
19
+ // auto emplace_result = symbols.emplace(id, literalt());
20
+ // literalt old_variable;
21
+
22
+ // We do not expect the identifier to be unique; in particular, nesting
23
+ // is supported. Thus, do we need to save a value from an outer scope?
22
24
23
25
// the symbol shall be visible during the recursive call
24
26
// to convert_bv
25
27
map.set_literals (id, expr.symbol ().type (), value_bv);
28
+
29
+ bool previous_record_cache_iterators = record_cache_iterators;
30
+ std::size_t previous_prop_cache_iterators_size = prop_cache_iterators.size ();
31
+ std::size_t previous_bv_cache_iterators_size = bv_cache_iterators.size ();
32
+ record_cache_iterators = true ;
33
+
34
+ // recursive call
26
35
bvt result_bv=convert_bv (expr.where ());
27
36
37
+ // clear cache_iterators that use the bound symbol from the cache
38
+ bv_cache_iterators.resize (previous_prop_cache_iterators_size);
39
+ bv_cache_iterators.resize (previous_bv_cache_iterators_size);
40
+ record_cache_iterators = previous_record_cache_iterators;
41
+
28
42
// now remove, no longer needed
29
43
map.erase_literals (id, expr.symbol ().type ());
30
44
0 commit comments