Skip to content

Commit 443eb20

Browse files
author
Daniel Kroening
authored
Merge pull request #3785 from tautschnig/deprecation-array_list_exprt
Construct array_list_exprt in a non-deprecated way
2 parents bac3719 + 1ae4c0b commit 443eb20

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/solvers/flattening/boolbv_get.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ exprt boolbvt::bv_get_unbounded_array(const exprt &expr) const
361361

362362
if(size_mpint>100 || size.id()==ID_infinity)
363363
{
364-
result = array_list_exprt(to_array_type(type));
364+
result = array_list_exprt({}, to_array_type(type));
365365
result.type().set(ID_size, integer2string(size_mpint));
366366

367367
result.operands().reserve(values.size()*2);

src/util/std_expr.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,11 @@ class array_list_exprt : public multi_ary_exprt
17961796
: multi_ary_exprt(ID_array_list, _type)
17971797
{
17981798
}
1799+
1800+
array_list_exprt(operandst &&_operands, const array_typet &_type)
1801+
: multi_ary_exprt(ID_array_list, std::move(_operands), _type)
1802+
{
1803+
}
17991804
};
18001805

18011806
template <>

unit/solvers/refinement/string_refinement/substitute_array_list.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ SCENARIO("substitute_array_list",
2121
const typet char_type=unsignedbv_typet(16);
2222
const typet int_type=signedbv_typet(32);
2323
const array_typet array_type(char_type, infinity_exprt(int_type));
24-
array_list_exprt arr(array_type);
2524
const exprt index0=from_integer(0, int_type);
2625
const exprt charx=from_integer('x', char_type);
2726
const exprt index1=from_integer(1, int_type);
2827
const exprt chary=from_integer('y', char_type);
2928
const exprt index100=from_integer(100, int_type);
3029

3130
// arr is `array-list [ 0 , 'x' , 1 , 'y' , 2 , 'z']`
32-
arr.operands()=
33-
{ index0, charx, index1, chary, index100, from_integer('z', char_type) };
31+
array_list_exprt arr(
32+
{index0, charx, index1, chary, index100, from_integer('z', char_type)},
33+
array_type);
3434

3535
// Max length is 2, so index 2 should get ignored.
3636
const exprt subst=substitute_array_lists(arr, 2);

0 commit comments

Comments
 (0)