We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6111fd1 commit 8277a70Copy full SHA for 8277a70
src/solvers/flattening/boolbv_byte_extract.cpp
@@ -133,19 +133,14 @@ bvt boolbvt::convert_byte_extract(const byte_extract_exprt &expr)
133
134
if(index.has_value())
135
{
136
- if(*index < 0)
137
- throw "byte_extract flatting with negative offset: "+expr.pretty();
138
-
139
const mp_integer offset = *index * byte_width;
140
141
- std::size_t offset_i=integer2unsigned(offset);
142
143
for(std::size_t i=0; i<width; i++)
144
// out of bounds?
145
- if(offset<0 || offset_i+i>=op_bv.size())
+ if(offset + i < 0 || offset + i >= op_bv.size())
146
bv[i]=prop.new_variable();
147
else
148
- bv[i]=op_bv[offset_i+i];
+ bv[i] = op_bv[numeric_cast_v<std::size_t>(offset) + i];
149
}
150
151
0 commit comments