Skip to content

Commit e316c7d

Browse files
committed
JBMC: add property checks on a per-function basis
1 parent 4059e3d commit e316c7d

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

src/analyses/goto_check.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,10 +1753,11 @@ void goto_checkt::goto_check(
17531753
void goto_check(
17541754
const namespacet &ns,
17551755
const optionst &options,
1756+
const irep_idt &mode,
17561757
goto_functionst::goto_functiont &goto_function)
17571758
{
17581759
goto_checkt goto_check(ns, options);
1759-
goto_check.goto_check(goto_function, irep_idt());
1760+
goto_check.goto_check(goto_function, mode);
17601761
}
17611762

17621763
void goto_check(

src/analyses/goto_check.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ void goto_check(
2626
void goto_check(
2727
const namespacet &ns,
2828
const optionst &options,
29+
const irep_idt &mode,
2930
goto_functionst::goto_functiont &goto_function);
3031

3132
void goto_check(

src/goto-programs/lazy_goto_model.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class lazy_goto_modelt
5151
message_handlert &message_handler)
5252
{
5353
return lazy_goto_modelt(
54-
[&handler] (goto_model_functiont &function)
54+
[&handler, &options] (goto_model_functiont &function)
5555
{
56-
handler.process_goto_function(function);
56+
handler.process_goto_function(function, options);
5757
},
5858
[&handler, &options] (goto_modelt &goto_model) -> bool
5959
{

src/jbmc/jbmc_parse_options.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,8 @@ int jbmc_parse_optionst::get_goto_program(
636636
}
637637

638638
void jbmc_parse_optionst::process_goto_function(
639-
goto_model_functiont &function)
639+
goto_model_functiont &function,
640+
const optionst &options)
640641
{
641642
symbol_tablet &symbol_table = function.get_symbol_table();
642643
goto_functionst::goto_functiont &goto_function = function.get_goto_function();
@@ -675,6 +676,13 @@ void jbmc_parse_optionst::process_goto_function(
675676
function,
676677
get_message_handler(),
677678
factory_params);
679+
680+
// add generic checks
681+
goto_check(
682+
namespacet(function.get_symbol_table()),
683+
options,
684+
ID_java,
685+
function.get_goto_function());
678686
}
679687

680688
catch(const char *e)
@@ -712,10 +720,6 @@ bool jbmc_parse_optionst::process_goto_functions(
712720
// instrument library preconditions
713721
instrument_preconditions(goto_model);
714722

715-
// add generic checks
716-
status() << "Generic Property Instrumentation" << eom;
717-
goto_check(options, goto_model);
718-
719723
// checks don't know about adjusted float expressions
720724
adjust_float_expressions(goto_model);
721725

src/jbmc/jbmc_parse_options.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ class jbmc_parse_optionst:
8080
const char **argv,
8181
const std::string &extra_options);
8282

83-
void process_goto_function(goto_model_functiont &function);
83+
void process_goto_function(
84+
goto_model_functiont &function, const optionst &options);
8485
bool process_goto_functions(goto_modelt &goto_model, const optionst &options);
8586

8687
protected:

0 commit comments

Comments
 (0)