@@ -392,20 +392,20 @@ exprt taint_instrumentert::drive_access_path_through_super_classes(
392
392
// data types. We resolve the typecast so that we build the struct
393
393
// initialiser for the wrapper type and we initialise all members by making
394
394
// accesses to the corresponding members in the origin wrapped access path.
395
- exprt uncasted_access_path = access_path;
396
- while (uncasted_access_path .id () == ID_typecast)
397
- uncasted_access_path = to_typecast_expr (uncasted_access_path ).op ();
398
- uncasted_access_path =
399
- drive_access_path_through_super_classes (uncasted_access_path );
395
+ exprt uncast_access_path = access_path;
396
+ while (uncast_access_path .id () == ID_typecast)
397
+ uncast_access_path = to_typecast_expr (uncast_access_path ).op ();
398
+ uncast_access_path =
399
+ drive_access_path_through_super_classes (uncast_access_path );
400
400
const typet uncasted_access_path_type =
401
- instrumented_namespace.follow (uncasted_access_path .type ());
401
+ instrumented_namespace.follow (uncast_access_path .type ());
402
402
struct_exprt struct_expr (fixed_type);
403
403
// First we set the super instance (i.e. '@__CPROVER__super' member,
404
404
// which is actually the instance of the primitive type).
405
405
struct_expr.operands ().push_back (
406
406
typecast_exprt (
407
407
get_super_if_subclassed (
408
- uncasted_access_path ,
408
+ uncast_access_path ,
409
409
get_inverse_type_substitutions (),
410
410
get_instrumented_symbol_table ()),
411
411
access_path.type ()));
@@ -427,7 +427,7 @@ exprt taint_instrumentert::drive_access_path_through_super_classes(
427
427
)
428
428
{
429
429
struct_expr.operands ().push_back (member_exprt (
430
- uncasted_access_path , component.get_name (), bool_typet ()));
430
+ uncast_access_path , component.get_name (), bool_typet ()));
431
431
}
432
432
else
433
433
{
@@ -587,9 +587,10 @@ void taint_instrumentert::instrument_instructions_with_shadow_variables(
587
587
588
588
// There is a possibility, that asgn.lhs().type()!=asgn.rhs().type().
589
589
// This may occur only when asgn.rhs().type() is a wrapper of
590
- // a primitive data type and asgn.lhs() accesses the wrapped data.
590
+ // a primitive data type and asgn.lhs() is an unwrapped primitive
591
+ // (e.g. array length) that cannot carry taint.
591
592
// The code below resolves the inconsistency, by applying member
592
- // access to the super filed of the asgn.rhs() until we get to
593
+ // access to the super field of the asgn.rhs() until we get to
593
594
// the right one.
594
595
595
596
const auto &lhs_type =
@@ -613,8 +614,8 @@ void taint_instrumentert::instrument_instructions_with_shadow_variables(
613
614
const auto &struct_type = to_struct_type (rhs_type);
614
615
INVARIANT (
615
616
struct_type.has_component (taint_name_of_super_variable ()),
616
- " The type difference could occur only for wrapped primitives, "
617
- " so the struct must contain the super variable ." );
617
+ " Assignment has type mismatch that couldn't be resolved by "
618
+ " unwrapping the rhs ." );
618
619
asgn.rhs () = member_exprt (
619
620
asgn.rhs (),
620
621
struct_type.get_component (taint_name_of_super_variable ()));
0 commit comments