@@ -733,16 +733,6 @@ static optionalt<exprt> get_array(
733
733
ret.move_to_operands (arr_val.operands ()[i]);
734
734
return ret;
735
735
}
736
- else if (arr_val.id () == ID_symbol)
737
- {
738
- stream << " (sr::get_array) warning: symbol "
739
- << to_symbol_expr (arr_val).get_identifier ()
740
- << " not found by super_get" << eom;
741
- // `super_get` does not know anything about this array so we make one up
742
- for (size_t i = 0 ; i < n; i++)
743
- ret.copy_to_operands (exprt (ID_unknown, arr_val.type ().subtype ()));
744
- return ret;
745
- }
746
736
else
747
737
return {};
748
738
}
@@ -1954,6 +1944,32 @@ exprt string_refinementt::get(const exprt &expr) const
1954
1944
arr_model, generator.max_string_length , ns);
1955
1945
return concretized_array;
1956
1946
}
1947
+ else
1948
+ {
1949
+ const auto &arr_of_ptr = generator.get_arrays_of_pointers ();
1950
+ const auto arr_in_arr_of_ptr = std::find_if (
1951
+ arr_of_ptr.begin (),
1952
+ arr_of_ptr.end (),
1953
+ [arr](std::pair<exprt, array_string_exprt> pair) {
1954
+ return pair.second == arr;
1955
+ });
1956
+
1957
+ if (arr_in_arr_of_ptr != arr_of_ptr.end ())
1958
+ {
1959
+ exprt length = super_get (arr.length ());
1960
+ if (const auto n = expr_cast<std::size_t >(length))
1961
+ {
1962
+ exprt arr_model =
1963
+ array_exprt (array_typet (arr.type ().subtype (), length));
1964
+ for (size_t i = 0 ; i < *n; i++)
1965
+ arr_model.copy_to_operands (exprt (ID_unknown, arr.type ().subtype ()));
1966
+ const exprt concretized_array = concretize_arrays_in_expression (
1967
+ arr_model, generator.max_string_length , ns);
1968
+ return concretized_array;
1969
+ }
1970
+ }
1971
+ return arr;
1972
+ }
1957
1973
}
1958
1974
return supert::get (ecopy);
1959
1975
}
0 commit comments