Skip to content

Commit 35afe57

Browse files
committed
Ensure goto_model.goto_functions are valid after precondition instrumentation
This commit ensures the goto_model.goto_functions are updated during the instrument_preconditions function. This is due to some of these leaving locations uninitialized and this causing later problems with partial inlining (that can only occur in goto-analyzer). Fixes issue #6065
1 parent 4889328 commit 35afe57

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/goto-programs/instrument_preconditions.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ void instrument_preconditions(goto_modelt &goto_model)
139139
// now remove the preconditions
140140
for(auto &f_it : goto_model.goto_functions.function_map)
141141
remove_preconditions(f_it.second.body);
142+
// The above may leave some locations uninitialized, this update is a
143+
// sanity to check to ensure the goto model and functions are correct
144+
// for later passes.
145+
// Note that only the first loop is the one known to leave locations
146+
// uninitialized.
147+
goto_model.goto_functions.update();
142148
}
143149

144150
void remove_preconditions(goto_functiont &goto_function)

0 commit comments

Comments
 (0)