Skip to content

Commit d42839d

Browse files
authored
Merge pull request #6487 from tautschnig/preconditions-instantiate-array
Byte operator lowering: additional preconditions in instantiate_byte_…
2 parents dbb6a4d + 3008132 commit d42839d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/solvers/lowering/byte_operators.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,10 @@ static exprt::operandst instantiate_byte_array(
405405
src.operands().begin() + narrow_cast<std::ptrdiff_t>(upper_bound)};
406406
}
407407

408+
PRECONDITION(src.type().id() == ID_array || src.type().id() == ID_vector);
409+
PRECONDITION(
410+
can_cast_type<bitvector_typet>(src.type().subtype()) &&
411+
to_bitvector_type(src.type().subtype()).get_width() == 8);
408412
exprt::operandst bytes;
409413
bytes.reserve(upper_bound - lower_bound);
410414
for(std::size_t i = lower_bound; i < upper_bound; ++i)

0 commit comments

Comments
 (0)