@@ -226,12 +226,14 @@ static void substitute_function_applications_in_equations(
226
226
eq.rhs () = substitute_function_applications (eq.rhs (), generator);
227
227
}
228
228
229
- // / For now, any unsigned bitvector type is considered a character.
229
+ // / For now, any unsigned bitvector type of width smaller or equal to 16 is
230
+ // / considered a character.
230
231
// / \param type: a type
231
232
// / \return true if the given type represents characters
232
233
bool is_char_type (const typet &type)
233
234
{
234
- return type.id () == ID_unsignedbv;
235
+ return type.id () == ID_unsignedbv &&
236
+ to_unsignedbv_type (type).get_width () <= 16 ;
235
237
}
236
238
237
239
// / Distinguish char array from other types.
@@ -1686,7 +1688,7 @@ static void initial_index_set(
1686
1688
{
1687
1689
const exprt &cur = to_process.back ();
1688
1690
to_process.pop_back ();
1689
- if (cur.id ()== ID_index)
1691
+ if (cur.id () == ID_index && is_char_type (cur. type ()) )
1690
1692
{
1691
1693
const index_exprt &index_expr = to_index_expr (cur);
1692
1694
const exprt &s = index_expr.array ();
@@ -1732,7 +1734,7 @@ static void initial_index_set(
1732
1734
const auto end=axiom.premise ().depth_end ();
1733
1735
while (it!=end)
1734
1736
{
1735
- if (it->id ()== ID_index)
1737
+ if (it->id () == ID_index && is_char_type (it-> type ()) )
1736
1738
{
1737
1739
const exprt &s=it->op0 ();
1738
1740
const exprt &i=it->op1 ();
@@ -1766,7 +1768,7 @@ static void update_index_set(
1766
1768
{
1767
1769
exprt cur=to_process.back ();
1768
1770
to_process.pop_back ();
1769
- if (cur.id ()== ID_index)
1771
+ if (cur.id () == ID_index && is_char_type (cur. type ()) )
1770
1772
{
1771
1773
const exprt &s=cur.op0 ();
1772
1774
const exprt &i=cur.op1 ();
0 commit comments