@@ -170,28 +170,12 @@ void memory_snapshot_harness_generatort::add_init_section(
170
170
goto_modelt &goto_model) const
171
171
{
172
172
goto_functionst &goto_functions = goto_model.goto_functions ;
173
- symbol_tablet &symbol_table = goto_model.symbol_table ;
174
173
175
174
goto_functiont &goto_function =
176
175
goto_functions.function_map [entry_function_name];
177
- const symbolt &function_symbol = symbol_table.lookup_ref (entry_function_name);
178
176
179
177
goto_programt &goto_program = goto_function.body ;
180
178
181
- // introduce a symbol for a Boolean variable to indicate the point at which
182
- // the function initialisation is completed
183
- symbolt &func_init_done_symbol = get_fresh_aux_symbol (
184
- bool_typet (),
185
- id2string (entry_function_name),
186
- " func_init_done" ,
187
- function_symbol.location ,
188
- function_symbol.mode ,
189
- symbol_table);
190
- func_init_done_symbol.is_static_lifetime = true ;
191
- func_init_done_symbol.value = false_exprt ();
192
-
193
- const symbol_exprt func_init_done_var = func_init_done_symbol.symbol_expr ();
194
-
195
179
const goto_programt::const_targett start_it =
196
180
goto_program.instructions .begin ();
197
181
@@ -235,6 +219,9 @@ code_blockt memory_snapshot_harness_generatort::add_assignments_to_globals(
235
219
recursive_initialization.initialize (symbol.symbol_expr (), 0 , {}, code);
236
220
}
237
221
}
222
+
223
+ code.add (code_assignt{func_init_done_var, false_exprt{}});
224
+
238
225
return code;
239
226
}
240
227
@@ -337,6 +324,19 @@ void memory_snapshot_harness_generatort::generate(
337
324
const symbolt *called_function_symbol =
338
325
symbol_table.lookup (entry_function_name);
339
326
327
+ // introduce a symbol for a Boolean variable to indicate the point at which
328
+ // the function initialisation is completed
329
+ auto &func_init_done_symbol = get_fresh_aux_symbol (
330
+ bool_typet (),
331
+ id2string (entry_function_name),
332
+ " func_init_done" ,
333
+ source_locationt::nil (),
334
+ called_function_symbol->mode ,
335
+ symbol_table);
336
+ func_init_done_symbol.is_static_lifetime = true ;
337
+ func_init_done_symbol.value = false_exprt ();
338
+ func_init_done_var = func_init_done_symbol.symbol_expr ();
339
+
340
340
add_init_section (goto_model);
341
341
342
342
code_blockt harness_function_body =
0 commit comments