@@ -24,13 +24,6 @@ Author: Daniel Kroening, kroening@kroening.com
2424#include " path_storage.h"
2525#include " symex_assign.h"
2626
27- static void locality (
28- const irep_idt &function_identifier,
29- goto_symext::statet &state,
30- path_storaget &path_storage,
31- const goto_functionst::goto_functiont &goto_function,
32- const namespacet &ns);
33-
3427bool goto_symext::get_unwind_recursion (const irep_idt &, unsigned , unsigned )
3528{
3629 return false ;
@@ -328,7 +321,7 @@ void goto_symext::symex_function_call_post_clean(
328321 }
329322
330323 // preserve locality of local variables
331- locality (identifier, state, path_storage, goto_function, ns );
324+ locality (identifier, state, goto_function);
332325
333326 // assign actuals to formal parameters
334327 parameter_assignments (identifier, goto_function, state, cleaned_arguments);
@@ -457,26 +450,26 @@ void goto_symext::symex_end_of_function(statet &state)
457450 }
458451}
459452
460- // / Preserves locality of parameters of a given function by applying L1
461- // / renaming to them.
462- static void locality (
453+ void goto_symext::locality (
463454 const irep_idt &function_identifier,
464455 goto_symext::statet &state,
465- path_storaget &path_storage,
466- const goto_functionst::goto_functiont &goto_function,
467- const namespacet &ns)
456+ const goto_functionst::goto_functiont &goto_function)
468457{
469458 unsigned &frame_nr=
470459 state.threads [state.source .thread_nr ].function_frame [function_identifier];
471460 frame_nr++;
472461
473462 for (const auto ¶m : goto_function.parameter_identifiers )
474463 {
475- ( void ) state.add_object (
464+ const ssa_exprt &renamed_param = state.add_object (
476465 ns.lookup (param).symbol_expr (),
477- [&path_storage , &frame_nr](const irep_idt &l0_name) {
466+ [this , &frame_nr](const irep_idt &l0_name) {
478467 return path_storage.get_unique_l1_index (l0_name, frame_nr);
479468 },
480469 ns);
470+
471+ // Allocate shadow memory for parameters.
472+ // They are like local variables.
473+ shadow_memory.symex_field_local_init (state, renamed_param);
481474 }
482475}
0 commit comments