Skip to content

Commit 3838235

Browse files
smowtontautschnig
authored andcommitted
Comment on and clarify field-sensitivity-specific expression transformations
The function name was previously incorrect (it did more than it said), so now I just call both transformations from symex_assign.
1 parent 267e54d commit 3838235

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/goto-symex/symex_assign.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ static void rewrite_with_to_field_symbols(
291291
/// \param ns: namespace
292292
/// \param do_simplify: set to true if, and only if, simplification is enabled
293293
static void shift_indexed_access_to_lhs(
294-
goto_symext::statet &state,
295294
exprt &ssa_rhs,
296295
ssa_exprt &lhs_mod,
297296
const namespacet &ns,
@@ -358,8 +357,6 @@ static void shift_indexed_access_to_lhs(
358357
lhs_mod = to_ssa_expr(byte_extract);
359358
}
360359
}
361-
362-
rewrite_with_to_field_symbols(state, ssa_rhs, lhs_mod, ns);
363360
}
364361

365362
void goto_symext::symex_assign_symbol(
@@ -383,8 +380,13 @@ void goto_symext::symex_assign_symbol(
383380

384381
ssa_exprt lhs_mod = lhs;
385382

386-
shift_indexed_access_to_lhs(
387-
state, l2_rhs, lhs_mod, ns, symex_config.simplify_opt);
383+
// Note the following two calls are specifically required for
384+
// field-sensitivity. For example, with-expressions, which may have just been
385+
// introduced by symex_assign_struct_member, are transformed into member
386+
// expressions on the LHS. If we add an option to disable field-sensitivity
387+
// in the future these should be omitted.
388+
shift_indexed_access_to_lhs(l2_rhs, lhs_mod, ns, symex_config.simplify_opt);
389+
rewrite_with_to_field_symbols(state, l2_rhs, lhs_mod, ns);
388390

389391
do_simplify(l2_rhs);
390392

0 commit comments

Comments
 (0)