@@ -110,6 +110,7 @@ void validate_goto_modelt::do_goto_program_checks(
110
110
void validate_goto_modelt::entry_point_exists ()
111
111
{
112
112
DATA_CHECK (
113
+ vm,
113
114
function_map.find (goto_functionst::entry_point ()) != function_map.end (),
114
115
" an entry point must exist" );
115
116
}
@@ -125,6 +126,7 @@ void validate_goto_modelt::function_pointer_calls_removed()
125
126
const code_function_callt &function_call =
126
127
to_code_function_call (instr.code );
127
128
DATA_CHECK (
129
+ vm,
128
130
function_call.function ().id () == ID_symbol,
129
131
" no calls via function pointer should be present" );
130
132
}
@@ -138,22 +140,25 @@ void validate_goto_modelt::check_returns_removed()
138
140
{
139
141
const goto_functiont &goto_function = fun.second ;
140
142
DATA_CHECK (
143
+ vm,
141
144
goto_function.type .return_type ().id () == ID_empty,
142
145
" functions must have empty return type" );
143
146
144
147
for (const auto &instr : goto_function.body .instructions )
145
148
{
146
149
DATA_CHECK (
147
- !instr.is_return (), " no return instructions should be present" );
150
+ vm, !instr.is_return (), " no return instructions should be present" );
148
151
149
152
if (instr.is_function_call ())
150
153
{
151
154
const auto &function_call = to_code_function_call (instr.code );
152
155
DATA_CHECK (
153
- function_call.lhs ().is_nil (), " function call return should be nil" );
156
+ vm,
157
+ function_call.lhs ().is_nil (),
158
+ " function call return should be nil" );
154
159
155
160
const auto &callee = to_code_type (function_call.function ().type ());
156
- DATA_CHECK (callee.return_type ().id () == ID_empty, " " );
161
+ DATA_CHECK (vm, callee.return_type ().id () == ID_empty, " " );
157
162
}
158
163
}
159
164
}
@@ -193,6 +198,7 @@ void validate_goto_modelt::check_called_functions()
193
198
to_symbol_expr (function_call.function ()).get_identifier ();
194
199
195
200
DATA_CHECK (
201
+ vm,
196
202
function_map.find (identifier) != function_map.end (),
197
203
" every function call callee must be in the function map" );
198
204
}
@@ -203,6 +209,7 @@ void validate_goto_modelt::check_called_functions()
203
209
{
204
210
for (auto &identifier : test_for_function_address.identifiers )
205
211
DATA_CHECK (
212
+ vm,
206
213
function_map.find (identifier) != function_map.end (),
207
214
" every function whose address is taken must be in the "
208
215
" function map" );
@@ -219,6 +226,7 @@ void validate_goto_modelt::check_last_instruction()
219
226
if (fun.second .body_available ())
220
227
{
221
228
DATA_CHECK (
229
+ vm,
222
230
fun.second .body .instructions .back ().is_end_function (),
223
231
" last instruction should be of end function type" );
224
232
}
@@ -234,10 +242,12 @@ void validate_goto_modelt::check_sourcecode_location()
234
242
for (auto &instr : fun.second .body .instructions )
235
243
{
236
244
DATA_CHECK (
245
+ vm,
237
246
instr.code .source_location ().is_not_nil (),
238
247
" each instruction \" code\" field, must have non nil source location" );
239
248
240
249
DATA_CHECK (
250
+ vm,
241
251
instr.source_location .is_not_nil (),
242
252
" each instruction source location must not be nil" );
243
253
}
0 commit comments