@@ -442,10 +442,9 @@ symbol_exprt string_abstractiont::add_dummy_symbol_and_value(
442
442
build_unknown (whatt::LENGTH, false ),
443
443
to_array_type (source_type).size ().id () == ID_infinity
444
444
? build_unknown (whatt::SIZE, false )
445
- : to_array_type (source_type).size ()},
445
+ : typecast_exprt::conditional_cast (
446
+ to_array_type (source_type).size (), build_type (whatt::SIZE))},
446
447
string_struct);
447
-
448
- make_type (to_struct_expr (new_symbol.value ).op2 (), build_type (whatt::SIZE));
449
448
}
450
449
else
451
450
new_symbol.value =
@@ -1212,8 +1211,8 @@ goto_programt::targett string_abstractiont::abstract_char_assign(
1212
1211
i2.is_not_nil (),
1213
1212
" failed to create length-component for the left-hand-side" );
1214
1213
1215
- exprt new_length=i_lhs. index ();
1216
- make_type (new_length , i2.type ());
1214
+ exprt new_length =
1215
+ typecast_exprt::conditional_cast (i_lhs. index () , i2.type ());
1217
1216
1218
1217
if_exprt min_expr (binary_relation_exprt (new_length, ID_lt, i2),
1219
1218
new_length, i2);
@@ -1232,16 +1231,14 @@ goto_programt::targett string_abstractiont::abstract_char_assign(
1232
1231
i2.is_not_nil (),
1233
1232
" failed to create length-component for the left-hand-side" );
1234
1233
1235
- make_type (ptr.offset , build_type (whatt::LENGTH));
1236
- return
1237
- char_assign (
1238
- dest,
1239
- target,
1240
- new_lhs,
1241
- i2,
1242
- ptr.offset .is_nil ()?
1243
- from_integer (0 , build_type (whatt::LENGTH)):
1244
- ptr.offset );
1234
+ return char_assign (
1235
+ dest,
1236
+ target,
1237
+ new_lhs,
1238
+ i2,
1239
+ ptr.offset .is_nil () ? from_integer (0 , build_type (whatt::LENGTH))
1240
+ : typecast_exprt::conditional_cast (
1241
+ ptr.offset , build_type (whatt::LENGTH)));
1245
1242
}
1246
1243
}
1247
1244
0 commit comments