@@ -16,6 +16,7 @@ Date: April 2016
16
16
#include < sstream>
17
17
18
18
#include < util/cprover_prefix.h>
19
+ #include < util/invariant.h>
19
20
#include < util/message.h>
20
21
#include < util/namespace.h>
21
22
#include < util/config.h>
@@ -132,8 +133,8 @@ bool model_argc_argv(
132
133
symbol_table.add (it->second ))
133
134
UNREACHABLE;
134
135
}
136
+ POSTCONDITION (value.is_not_nil ());
135
137
136
- assert (value.is_not_nil ());
137
138
goto_convert (
138
139
to_code (value),
139
140
symbol_table,
@@ -147,15 +148,17 @@ bool model_argc_argv(
147
148
148
149
goto_functionst::function_mapt::iterator start_entry=
149
150
goto_functions.function_map .find (goto_functions.entry_point ());
150
- assert (
151
+ DATA_INVARIANT (
151
152
start_entry!=goto_functions.function_map .end () &&
152
- start_entry->second .body_available ());
153
+ start_entry->second .body_available (),
154
+ " entry point expected to have a body" );
153
155
154
156
goto_programt &start=start_entry->second .body ;
155
157
goto_programt::targett main_call=start.instructions .begin ();
156
158
for (goto_programt::targett end=start.instructions .end ();
157
159
main_call!=end;
158
160
++main_call)
161
+ {
159
162
if (main_call->is_function_call ())
160
163
{
161
164
const exprt &func=
@@ -164,8 +167,9 @@ bool model_argc_argv(
164
167
to_symbol_expr (func).get_identifier ()==main_symbol.name )
165
168
break ;
166
169
}
170
+ }
171
+ POSTCONDITION (main_call!=start.instructions .end ());
167
172
168
- assert (main_call!=start.instructions .end ());
169
173
start.insert_before_swap (main_call, init_instructions);
170
174
171
175
// update counters etc.
0 commit comments