Skip to content

Commit 0073ca7

Browse files
committed
Check that array_expr is not in length_of_array map in array_pool.cpp
Previously the string solver returned an error when constant propagation of strings was used as `array_poolt::insert()` might be called for array expressions for which there is already a mapping in the `length_of_array` map.
1 parent d5a4b59 commit 0073ca7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/solvers/strings/array_pool.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ void array_poolt::insert(
162162
INVARIANT(
163163
it_bool.second, "should not associate two arrays to the same pointer");
164164

165-
attempt_assign_length_from_type(array_expr, length_of_array, fresh_symbol);
165+
if(length_of_array.find(array_expr) == length_of_array.end())
166+
{
167+
attempt_assign_length_from_type(array_expr, length_of_array, fresh_symbol);
168+
}
166169
}
167170

168171
/// Return a map mapping all array_string_exprt of the array_pool to their

0 commit comments

Comments
 (0)