@@ -361,7 +361,16 @@ exprt string_refine_preprocesst::make_cprover_string_assign(
361361 std::list<code_assignt> assignments;
362362
363363 // 1) cprover_string_length= *(rhs->length)
364+ symbolt sym_length=get_fresh_aux_symbol (
365+ length_type,
366+ " cprover_string_length" ,
367+ " cprover_string_length" ,
368+ location,
369+ ID_java,
370+ symbol_table);
371+ symbol_exprt cprover_length=sym_length.symbol_expr ();
364372 member_exprt length (deref, " length" , length_type);
373+ assignments.emplace_back (cprover_length, length);
365374
366375 // 2) cprover_string_array = *(rhs->data)
367376 symbol_exprt array_lhs=fresh_array (data_type.subtype (), location);
@@ -373,7 +382,7 @@ exprt string_refine_preprocesst::make_cprover_string_assign(
373382 // This assignment is useful for finding witnessing strings for counter
374383 // examples
375384 refined_string_typet ref_type (length_type, java_char_type ());
376- string_exprt new_rhs (length , array_lhs, ref_type);
385+ string_exprt new_rhs (cprover_length , array_lhs, ref_type);
377386
378387 symbol_exprt lhs=fresh_string (new_rhs.type (), location);
379388 assignments.emplace_back (lhs, new_rhs);
0 commit comments