@@ -92,16 +92,21 @@ void stack_depth(
92
92
93
93
const exprt depth_expr (from_integer (depth, sym.type ()));
94
94
95
+ const irep_idt init_name = CPROVER_PREFIX " initialize" ;
96
+
95
97
Forall_goto_functions (f_it, goto_model.goto_functions )
96
- if (f_it->second .body_available () &&
97
- f_it->first !=CPROVER_PREFIX " initialize" &&
98
- f_it->first !=goto_functionst::entry_point ())
98
+ {
99
+ if (
100
+ f_it->second .body_available () && f_it->first != init_name &&
101
+ f_it->first != goto_functionst::entry_point ())
102
+ {
99
103
stack_depth (f_it->second .body , sym, depth, depth_expr);
104
+ }
105
+ }
100
106
101
107
// initialize depth to 0
102
- goto_functionst::function_mapt::iterator
103
- i_it=goto_model.goto_functions .function_map .find (
104
- CPROVER_PREFIX " initialize" );
108
+ goto_functionst::function_mapt::iterator i_it =
109
+ goto_model.goto_functions .function_map .find (init_name);
105
110
DATA_INVARIANT (
106
111
i_it!=goto_model.goto_functions .function_map .end (),
107
112
" __CPROVER_initialize must exist" );
@@ -111,8 +116,8 @@ void stack_depth(
111
116
goto_programt::targett it=init.insert_before (first);
112
117
it->make_assignment ();
113
118
it->code =code_assignt (sym, from_integer (0 , sym.type ()));
114
- it-> source_location =first-> source_location ;
115
- it->function =first-> function ;
119
+ // no suitable value for source location -- omitted
120
+ it->function = init_name ;
116
121
117
122
// update counters etc.
118
123
goto_model.goto_functions .update ();
0 commit comments