@@ -149,7 +149,7 @@ static void check_apply_invariants(
149
149
150
150
// change the back edge into assume(false) or assume(guard)
151
151
loop_end->targets .clear ();
152
- loop_end->type = ASSUME;
152
+ loop_end->type = ASSUME;
153
153
if (loop_head->is_goto ())
154
154
loop_end->set_condition (false_exprt ());
155
155
else
@@ -265,7 +265,7 @@ bool code_contractst::apply_function_contract(
265
265
}
266
266
267
267
// Replace formal parameters
268
- code_function_callt::argumentst::const_iterator a_it =
268
+ code_function_callt::argumentst::const_iterator a_it=
269
269
call.arguments ().begin ();
270
270
for (code_typet::parameterst::const_iterator p_it = type.parameters ().begin ();
271
271
p_it != type.parameters ().end () && a_it != call.arguments ().end ();
@@ -480,38 +480,38 @@ void code_contractst::instrument_call_statement(
480
480
481
481
return ;
482
482
}
483
- else // Called function has assigns clause
484
- {
485
- replace_symbolt replace;
486
- // Replace formal parameters
487
- code_function_callt::argumentst::const_iterator a_it =
488
- call.arguments ().begin ();
489
- for (code_typet::parameterst::const_iterator p_it =
490
- called_type.parameters ().begin ();
491
- p_it != called_type.parameters ().end () &&
492
- a_it != call.arguments ().end ();
493
- ++p_it, ++a_it)
483
+ else // Called function has assigns clause
494
484
{
495
- if (!p_it->get_identifier ().empty ())
485
+ replace_symbolt replace;
486
+ // Replace formal parameters
487
+ code_function_callt::argumentst::const_iterator a_it =
488
+ call.arguments ().begin ();
489
+ for (code_typet::parameterst::const_iterator p_it =
490
+ called_type.parameters ().begin ();
491
+ p_it != called_type.parameters ().end () &&
492
+ a_it != call.arguments ().end ();
493
+ ++p_it, ++a_it)
496
494
{
497
- symbol_exprt p (p_it->get_identifier (), p_it->type ());
498
- replace.insert (p, *a_it);
495
+ if (!p_it->get_identifier ().empty ())
496
+ {
497
+ symbol_exprt p (p_it->get_identifier (), p_it->type ());
498
+ replace.insert (p, *a_it);
499
+ }
499
500
}
500
- }
501
501
502
- replace (called_assigns);
503
-
504
- // check compatibility of assigns clause with the called function
505
- assigns_clauset called_assigns_clause (
506
- called_assigns, *this , function_id, log );
507
- exprt compatible =
508
- assigns_clause.compatible_expression (called_assigns_clause);
509
- goto_programt alias_assertion;
510
- alias_assertion.add (goto_programt::make_assertion (
511
- compatible, instruction_iterator->source_location ));
512
- program.insert_before_swap (instruction_iterator, alias_assertion);
513
- ++instruction_iterator;
514
- }
502
+ replace (called_assigns);
503
+
504
+ // check compatibility of assigns clause with the called function
505
+ assigns_clauset called_assigns_clause (
506
+ called_assigns, *this , function_id, log );
507
+ exprt compatible =
508
+ assigns_clause.compatible_expression (called_assigns_clause);
509
+ goto_programt alias_assertion;
510
+ alias_assertion.add (goto_programt::make_assertion (
511
+ compatible, instruction_iterator->source_location ));
512
+ program.insert_before_swap (instruction_iterator, alias_assertion);
513
+ ++instruction_iterator;
514
+ }
515
515
}
516
516
517
517
bool code_contractst::check_for_looped_mallocs (const goto_programt &program)
@@ -785,7 +785,7 @@ void code_contractst::add_contract_check(
785
785
.symbol_expr ();
786
786
check.add (goto_programt::make_decl (r, skip->source_location ));
787
787
788
- call.lhs () = r;
788
+ call.lhs ()= r;
789
789
return_stmt = code_returnt (r);
790
790
791
791
symbol_exprt ret_val (CPROVER_PREFIX " return_value" , call.lhs ().type ());
0 commit comments