@@ -390,35 +390,33 @@ void goto_symext::symex_assign_symbol(
390
390
391
391
do_simplify (l2_rhs);
392
392
393
- ssa_exprt ssa_lhs = lhs_mod;
393
+ ssa_exprt l2_lhs = lhs_mod;
394
+ ssa_exprt l1_lhs = l2_lhs; // l2_lhs will be renamed to L2 by the following:
394
395
state.assignment (
395
- ssa_lhs ,
396
+ l2_lhs ,
396
397
l2_rhs,
397
398
ns,
398
399
symex_config.simplify_opt ,
399
400
symex_config.constant_propagation ,
400
401
symex_config.allow_pointer_unsoundness );
401
402
402
403
exprt ssa_full_lhs=full_lhs;
403
- ssa_full_lhs= add_to_lhs (ssa_full_lhs, ssa_lhs );
404
+ ssa_full_lhs = add_to_lhs (ssa_full_lhs, l2_lhs );
404
405
const bool record_events=state.record_events ;
405
406
state.record_events =false ;
406
407
exprt l2_full_lhs = state.rename (std::move (ssa_full_lhs), ns).get ();
407
408
state.record_events =record_events;
408
409
409
410
// do the assignment
410
- const symbolt &symbol = ns.lookup (ssa_lhs .get_object_name ());
411
+ const symbolt &symbol = ns.lookup (l2_lhs .get_object_name ());
411
412
412
413
if (symbol.is_auxiliary )
413
414
assignment_type=symex_targett::assignment_typet::HIDDEN;
414
415
415
416
log .conditional_output (
416
- log .debug (),
417
- [this , &ssa_lhs](messaget::mstreamt &mstream) {
418
- mstream << " Assignment to " << ssa_lhs.get_identifier ()
419
- << " ["
420
- << pointer_offset_bits (ssa_lhs.type (), ns).value_or (0 )
421
- << " bits]"
417
+ log .debug (), [this , &l2_lhs](messaget::mstreamt &mstream) {
418
+ mstream << " Assignment to " << l2_lhs.get_identifier () << " ["
419
+ << pointer_offset_bits (l2_lhs.type (), ns).value_or (0 ) << " bits]"
422
420
<< messaget::eom;
423
421
});
424
422
@@ -429,13 +427,25 @@ void goto_symext::symex_assign_symbol(
429
427
get_original_name (original_lhs);
430
428
target.assignment (
431
429
conjunction (guard),
432
- ssa_lhs ,
430
+ l2_lhs ,
433
431
l2_full_lhs,
434
432
original_lhs,
435
433
l2_rhs,
436
434
state.source ,
437
435
assignment_type);
438
436
437
+ if (field_sensitivityt::is_divisible (l1_lhs))
438
+ {
439
+ // Split composite symbol lhs into its components
440
+ state.field_sensitivity .field_assignments (
441
+ ns, state, l1_lhs, target, symex_config.allow_pointer_unsoundness );
442
+ // Erase the composite symbol from our working state. Note that we need to
443
+ // have it in the propagation table and the value set while doing the field
444
+ // assignments, thus we cannot skip putting it in there above.
445
+ state.propagation .erase (l1_lhs.get_identifier ());
446
+ state.value_set .erase_symbol (l1_lhs, ns);
447
+ }
448
+
439
449
// Restore the guard
440
450
guard.pop_back ();
441
451
}
0 commit comments