Skip to content

Commit 88c669e

Browse files
committed
SMT2 back-end: do not flatten flattened arrays
convert_expr may flatten an array anyway, in which case flatten_array would generate select statements over bitvectors instead of arrays (as flatten_array itself invokes convert_expr to supposedly construct the array expression).
1 parent bc1012b commit 88c669e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

regression/cbmc/Array_operations2/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE broken-smt-backend
1+
CORE
22
main.c
33

44
^\[main.assertion.12\] line 34 assertion arr\[1\].c\[2\] == 0: FAILURE$

src/solvers/smt2/smt2_conv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3060,7 +3060,7 @@ void smt2_convt::convert_struct(const struct_exprt &expr)
30603060
exprt op=expr.operands()[i-1];
30613061

30623062
// may need to flatten array-theory arrays in there
3063-
if(op.type().id() == ID_array)
3063+
if(op.type().id() == ID_array && use_array_theory(op))
30643064
flatten_array(op);
30653065
else if(op.type().id() == ID_bool)
30663066
flatten2bv(op);

0 commit comments

Comments
 (0)