Skip to content

Commit cf0875a

Browse files
authored
Merge pull request #1047 from smowton/smowton/fix/cleanup_array_errors_hotfix
Replace std::cout for errors with messaget::error()
2 parents 8cf48d3 + 610d78a commit cf0875a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/solvers/flattening/arrays.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ literalt arrayst::record_array_equality(
4949
// check types
5050
if(!base_type_eq(op0.type(), op1.type(), ns))
5151
{
52-
std::cout << equality.pretty() << '\n';
52+
prop.error() << equality.pretty() << messaget::eom;
5353
throw "record_array_equality got equality without matching types";
5454
}
5555

@@ -115,7 +115,7 @@ void arrayst::collect_arrays(const exprt &a)
115115
// check types
116116
if(!base_type_eq(array_type, a.op0().type(), ns))
117117
{
118-
std::cout << a.pretty() << '\n';
118+
prop.error() << a.pretty() << messaget::eom;
119119
throw "collect_arrays got 'with' without matching types";
120120
}
121121

@@ -137,7 +137,7 @@ void arrayst::collect_arrays(const exprt &a)
137137
// check types
138138
if(!base_type_eq(array_type, a.op0().type(), ns))
139139
{
140-
std::cout << a.pretty() << '\n';
140+
prop.error() << a.pretty() << messaget::eom;
141141
throw "collect_arrays got 'update' without matching types";
142142
}
143143

@@ -161,14 +161,14 @@ void arrayst::collect_arrays(const exprt &a)
161161
// check types
162162
if(!base_type_eq(array_type, a.op1().type(), ns))
163163
{
164-
std::cout << a.pretty() << '\n';
164+
prop.error() << a.pretty() << messaget::eom;
165165
throw "collect_arrays got if without matching types";
166166
}
167167

168168
// check types
169169
if(!base_type_eq(array_type, a.op2().type(), ns))
170170
{
171-
std::cout << a.pretty() << '\n';
171+
prop.error() << a.pretty() << messaget::eom;
172172
throw "collect_arrays got if without matching types";
173173
}
174174

@@ -535,8 +535,8 @@ void arrayst::add_array_constraints_with(
535535

536536
if(index_expr.type()!=value.type())
537537
{
538-
std::cout << expr.pretty() << '\n';
539-
assert(false);
538+
prop.error() << expr.pretty() << messaget::eom;
539+
throw "index_expr and value types should match";
540540
}
541541

542542
lazy_constraintt lazy(
@@ -619,8 +619,8 @@ void arrayst::add_array_constraints_update(
619619

620620
if(index_expr.type()!=value.type())
621621
{
622-
std::cout << expr.pretty() << '\n';
623-
assert(false);
622+
prop.error() << expr.pretty() << messaget::eom;
623+
throw "index_expr and value types should match";
624624
}
625625

626626
set_to_true(equal_exprt(index_expr, value));

0 commit comments

Comments
 (0)