19
19
#include < goto-programs/remove_skip.h>
20
20
21
21
#include < util/irep_ids.h>
22
+ #include < util/invariant.h>
22
23
23
24
// / Holds information about any discovered nondet methods, with extreme type-
24
25
// / safety.
@@ -176,7 +177,7 @@ static goto_programt::targett check_and_replace_target(
176
177
}
177
178
178
179
// Look at the next instruction, ensure that it is an assignment
179
- assert (next_instr->is_assign ());
180
+ INVARIANT (next_instr->is_assign (), " expected assign instruction " );
180
181
// Get the name of the LHS of the assignment
181
182
const auto &next_instr_assign_lhs = to_code_assign (next_instr->code ).lhs ();
182
183
if (
@@ -200,7 +201,7 @@ static goto_programt::targett check_and_replace_target(
200
201
return is_assignment_from (instr, return_identifier);
201
202
});
202
203
203
- assert (matching_assignment != end);
204
+ CHECK_RETURN (matching_assignment != end);
204
205
205
206
// Assume that the LHS of *this* assignment is the actual nondet variable
206
207
const auto &code_assign = to_code_assign (matching_assignment->code );
@@ -209,7 +210,7 @@ static goto_programt::targett check_and_replace_target(
209
210
210
211
// Erase from the nondet function call to the assignment
211
212
const auto after_matching_assignment = std::next (matching_assignment);
212
- assert (after_matching_assignment != end);
213
+ CHECK_RETURN (after_matching_assignment != end);
213
214
214
215
std::for_each (
215
216
target,
0 commit comments