@@ -84,9 +84,9 @@ exprt field_sensitivityt::apply(
84
84
member.struct_op () = tmp.get_original_expr ();
85
85
tmp.set_expression (member);
86
86
if (was_l2)
87
- return state.rename (std::move (tmp), ns).get ();
87
+ return apply (ns, state, state .rename (std::move (tmp), ns).get (), write );
88
88
else
89
- return std::move (tmp);
89
+ return apply (ns, state, std::move (tmp), write );
90
90
}
91
91
}
92
92
else if (
@@ -116,9 +116,12 @@ exprt field_sensitivityt::apply(
116
116
tmp.type () = be.type ();
117
117
tmp.set_expression (*recursive_member);
118
118
if (was_l2)
119
- return state.rename (std::move (tmp), ns).get ();
119
+ {
120
+ return apply (
121
+ ns, state, state.rename (std::move (tmp), ns).get (), write );
122
+ }
120
123
else
121
- return std::move (tmp);
124
+ return apply (ns, state, std::move (tmp), write );
122
125
}
123
126
}
124
127
}
@@ -171,9 +174,12 @@ exprt field_sensitivityt::apply(
171
174
index .index () = l2_index.get ();
172
175
tmp.set_expression (index );
173
176
if (was_l2)
174
- return state.rename (std::move (tmp), ns).get ();
177
+ {
178
+ return apply (
179
+ ns, state, state.rename (std::move (tmp), ns).get (), write );
180
+ }
175
181
else
176
- return std::move (tmp);
182
+ return apply (ns, state, std::move (tmp), write );
177
183
}
178
184
else if (!write )
179
185
{
@@ -293,6 +299,14 @@ void field_sensitivityt::field_assignments(
293
299
{
294
300
field_assignments_rec (
295
301
ns, state, lhs_fs, rhs, target, allow_pointer_unsoundness);
302
+ // Erase the composite symbol from our working state. Note that we need to
303
+ // have it in the propagation table and the value set while doing the field
304
+ // assignments, thus we cannot skip putting it in there above.
305
+ if (is_divisible (lhs, true ))
306
+ {
307
+ state.propagation .erase_if_exists (lhs.get_identifier ());
308
+ state.value_set .erase_symbol (lhs, ns);
309
+ }
296
310
}
297
311
}
298
312
@@ -316,15 +330,11 @@ void field_sensitivityt::field_assignments_rec(
316
330
{
317
331
if (is_ssa_expr (lhs_fs))
318
332
{
319
- const ssa_exprt ssa_lhs = state
320
- .assignment (
321
- to_ssa_expr (lhs_fs),
322
- ssa_rhs,
323
- ns,
324
- true ,
325
- true ,
326
- allow_pointer_unsoundness)
327
- .get ();
333
+ const ssa_exprt &l1_lhs = to_ssa_expr (lhs_fs);
334
+ const ssa_exprt ssa_lhs =
335
+ state
336
+ .assignment (l1_lhs, ssa_rhs, ns, true , true , allow_pointer_unsoundness)
337
+ .get ();
328
338
329
339
// do the assignment
330
340
target.assignment (
@@ -335,6 +345,14 @@ void field_sensitivityt::field_assignments_rec(
335
345
ssa_rhs,
336
346
state.source ,
337
347
symex_targett::assignment_typet::STATE);
348
+ // Erase the composite symbol from our working state. Note that we need to
349
+ // have it in the propagation table and the value set while doing the field
350
+ // assignments, thus we cannot skip putting it in there above.
351
+ if (is_divisible (l1_lhs, true ))
352
+ {
353
+ state.propagation .erase_if_exists (l1_lhs.get_identifier ());
354
+ state.value_set .erase_symbol (l1_lhs, ns);
355
+ }
338
356
}
339
357
else if (
340
358
ssa_rhs.type ().id () == ID_struct || ssa_rhs.type ().id () == ID_struct_tag)
0 commit comments