|
24 | 24 | #include "path_storage.h"
|
25 | 25 | #include "symex_assign.h"
|
26 | 26 |
|
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 |
| - |
34 | 27 | bool goto_symext::get_unwind_recursion(const irep_idt &, unsigned, unsigned)
|
35 | 28 | {
|
36 | 29 | return false;
|
@@ -328,7 +321,7 @@ void goto_symext::symex_function_call_post_clean(
|
328 | 321 | }
|
329 | 322 |
|
330 | 323 | // preserve locality of local variables
|
331 |
| - locality(identifier, state, path_storage, goto_function, ns); |
| 324 | + locality(identifier, state, goto_function); |
332 | 325 |
|
333 | 326 | // assign actuals to formal parameters
|
334 | 327 | parameter_assignments(identifier, goto_function, state, cleaned_arguments);
|
@@ -457,26 +450,26 @@ void goto_symext::symex_end_of_function(statet &state)
|
457 | 450 | }
|
458 | 451 | }
|
459 | 452 |
|
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( |
463 | 454 | const irep_idt &function_identifier,
|
464 | 455 | 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) |
468 | 457 | {
|
469 | 458 | unsigned &frame_nr=
|
470 | 459 | state.threads[state.source.thread_nr].function_frame[function_identifier];
|
471 | 460 | frame_nr++;
|
472 | 461 |
|
473 | 462 | for(const auto ¶m : goto_function.parameter_identifiers)
|
474 | 463 | {
|
475 |
| - (void)state.add_object( |
| 464 | + const ssa_exprt &renamed_param = state.add_object( |
476 | 465 | ns.lookup(param).symbol_expr(),
|
477 |
| - [&path_storage, &frame_nr](const irep_idt &l0_name) { |
| 466 | + [this, &frame_nr](const irep_idt &l0_name) { |
478 | 467 | return path_storage.get_unique_l1_index(l0_name, frame_nr);
|
479 | 468 | },
|
480 | 469 | ns);
|
| 470 | + |
| 471 | + // Allocate shadow memory for parameters. |
| 472 | + // They are like local variables. |
| 473 | + shadow_memory.symex_field_local_init(state, renamed_param); |
481 | 474 | }
|
482 | 475 | }
|
0 commit comments