@@ -390,35 +390,33 @@ void goto_symext::symex_assign_symbol(
390390
391391 do_simplify (l2_rhs);
392392
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:
394395 state.assignment (
395- ssa_lhs ,
396+ l2_lhs ,
396397 l2_rhs,
397398 ns,
398399 symex_config.simplify_opt ,
399400 symex_config.constant_propagation ,
400401 symex_config.allow_pointer_unsoundness );
401402
402403 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 );
404405 const bool record_events=state.record_events ;
405406 state.record_events =false ;
406407 exprt l2_full_lhs = state.rename (std::move (ssa_full_lhs), ns).get ();
407408 state.record_events =record_events;
408409
409410 // 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 ());
411412
412413 if (symbol.is_auxiliary )
413414 assignment_type=symex_targett::assignment_typet::HIDDEN;
414415
415416 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]"
422420 << messaget::eom;
423421 });
424422
@@ -429,13 +427,25 @@ void goto_symext::symex_assign_symbol(
429427 get_original_name (original_lhs);
430428 target.assignment (
431429 conjunction (guard),
432- ssa_lhs ,
430+ l2_lhs ,
433431 l2_full_lhs,
434432 original_lhs,
435433 l2_rhs,
436434 state.source ,
437435 assignment_type);
438436
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+
439449 // Restore the guard
440450 guard.pop_back ();
441451}
0 commit comments