@@ -15,13 +15,15 @@ Author: Daniel Kroening, kroening@kroening.com
1515#include < util/message.h>
1616
1717#include " complexity_limiter.h"
18+ #include " shadow_memory.h"
1819#include " symex_config.h"
1920#include " symex_target_equation.h"
2021
2122class address_of_exprt ;
2223class function_application_exprt ;
2324class goto_symex_statet ;
2425class path_storaget ;
26+ class shadow_memory_field_definitionst ;
2527class side_effect_exprt ;
2628class symex_assignt ;
2729class typet ;
@@ -65,7 +67,16 @@ class goto_symext
6567 path_segment_vccs(0 ),
6668 _total_vccs(std::numeric_limits<unsigned >::max()),
6769 _remaining_vccs(std::numeric_limits<unsigned >::max()),
68- complexity_module(mh, options)
70+ complexity_module(mh, options),
71+ shadow_memory(
72+ std::bind (
73+ &goto_symext::symex_assign,
74+ this ,
75+ std::placeholders::_1,
76+ std::placeholders::_2,
77+ std::placeholders::_3),
78+ ns,
79+ mh)
6980 {
7081 }
7182
@@ -98,16 +109,24 @@ class goto_symext
98109 // / having the state around afterwards.
99110 // / \param get_goto_function: The delegate to retrieve function bodies (see
100111 // / \ref get_goto_functiont)
112+ // / \param fields The shadow memory field declarations
101113 // / \return A symbol table holding the symbols added during symbolic
102114 // / execution.
103115 NODISCARD
104- virtual symbol_tablet
105- symex_from_entry_point_of (const get_goto_functiont &get_goto_function);
116+ virtual symbol_tablet symex_from_entry_point_of (
117+ const get_goto_functiont &get_goto_function,
118+ const shadow_memory_field_definitionst &fields);
106119
107120 // / Puts the initial state of the entry point function into the path storage
121+ // / \param get_goto_function: The delegate to retrieve function bodies (see
122+ // / \ref get_goto_functiont)
123+ // / \param new_symbol_table: A symbol table to store the symbols added during
124+ // / symbolic execution
125+ // / \param fields The shadow memory field declarations
108126 virtual void initialize_path_storage_from_entry_point_of (
109127 const get_goto_functiont &get_goto_function,
110- symbol_table_baset &new_symbol_table);
128+ symbol_table_baset &new_symbol_table,
129+ const shadow_memory_field_definitionst &fields);
111130
112131 // / Performs symbolic execution using a state and equation that have
113132 // / already been used to symbolically execute part of the program. The state
@@ -446,6 +465,16 @@ class goto_symext
446465 statet &state,
447466 const goto_programt::instructiont &instruction);
448467
468+ // / Preserves locality of parameters of a given function by applying L1
469+ // / renaming to them.
470+ // / \param function_identifier The parameter identifier
471+ // / \param state The current state
472+ // / \param goto_function The goto function
473+ virtual void locality (
474+ const irep_idt &function_identifier,
475+ goto_symext::statet &state,
476+ const goto_functionst::goto_functiont &goto_function);
477+
449478 // / Symbolically execute a END_FUNCTION instruction.
450479 // / \param state: Symbolic execution state for current instruction
451480 virtual void symex_end_of_function (statet &);
@@ -815,6 +844,9 @@ class goto_symext
815844
816845 complexity_limitert complexity_module;
817846
847+ // / Shadow memory instrumentation API
848+ shadow_memoryt shadow_memory;
849+
818850public:
819851 unsigned get_total_vccs () const
820852 {
0 commit comments