Skip to content

Commit 35ad715

Browse files
committed
split up goto_check
goto_check inserts assertions that check for suspect bugs in both C/C++ and Java programs. The criteria differ vastly given that Java has basically no instances of undefined behavior. This commit splits the file, separating it into a checker for C/C++ and one for Java. The long-term plan is to move these checkers into the directory of the corresponding language frontend.
1 parent d42839d commit 35ad715

17 files changed

+5161
-2504
lines changed

jbmc/src/janalyzer/janalyzer_parse_options.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ void janalyzer_parse_optionst::help()
797797
HELP_SHOW_PROPERTIES
798798
"\n"
799799
"Program instrumentation options:\n"
800-
HELP_GOTO_CHECK
800+
HELP_GOTO_CHECK_JAVA
801801
"\n"
802802
"Other options:\n"
803803
" --version show version and exit\n"

jbmc/src/janalyzer/janalyzer_parse_options.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Author: Daniel Kroening, [email protected]
108108
#include <goto-programs/show_goto_functions.h>
109109
#include <goto-programs/show_properties.h>
110110

111-
#include <analyses/goto_check.h>
111+
#include <analyses/goto_check_java.h>
112112

113113
#include <java_bytecode/java_bytecode_language.h>
114114

@@ -128,7 +128,7 @@ class optionst;
128128
"(little-endian)(big-endian)" \
129129
OPT_SHOW_GOTO_FUNCTIONS \
130130
OPT_SHOW_PROPERTIES \
131-
OPT_GOTO_CHECK \
131+
OPT_GOTO_CHECK_JAVA \
132132
"(show-loops)" \
133133
"(show-symbol-table)(show-parse-tree)" \
134134
"(show-reachable-properties)(property):" \

jbmc/src/jbmc/jbmc_parse_options.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ void jbmc_parse_optionst::get_command_line_options(optionst &options)
228228
"self-loops-to-assumptions",
229229
!cmdline.isset("no-self-loops-to-assumptions"));
230230

231-
// all checks supported by goto_check
232-
PARSE_OPTIONS_GOTO_CHECK(cmdline, options);
231+
// all checks supported by goto_check_java
232+
PARSE_OPTIONS_GOTO_CHECK_JAVA(cmdline, options);
233233

234234
// unwind loops in java enum static initialization
235235
if(cmdline.isset("java-unwind-enum-static"))
@@ -811,7 +811,7 @@ void jbmc_parse_optionst::process_goto_function(
811811
}
812812

813813
// add generic checks
814-
goto_check(
814+
goto_check_java(
815815
function.get_function_id(),
816816
function.get_goto_function(),
817817
ns,

jbmc/src/jbmc/jbmc_parse_options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Author: Daniel Kroening, [email protected]
1919

2020
#include <langapi/language.h>
2121

22-
#include <analyses/goto_check.h>
22+
#include <analyses/goto_check_java.h>
2323

2424
#include <goto-checker/bmc_util.h>
2525

jbmc/src/jdiff/jdiff_parse_options.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void jdiff_parse_optionst::get_command_line_options(optionst &options)
7575
options.set_option("mm", cmdline.get_value("mm"));
7676

7777
// all checks supported by goto_check
78-
PARSE_OPTIONS_GOTO_CHECK(cmdline, options);
78+
PARSE_OPTIONS_GOTO_CHECK_JAVA(cmdline, options);
7979

8080
if(cmdline.isset("debug-level"))
8181
options.set_option("debug-level", cmdline.get_value("debug-level"));
@@ -278,7 +278,7 @@ bool jdiff_parse_optionst::process_goto_program(
278278

279279
// add generic checks
280280
log.status() << "Generic Property Instrumentation" << messaget::eom;
281-
goto_check(options, goto_model, ui_message_handler);
281+
goto_check_java(options, goto_model, ui_message_handler);
282282

283283
// checks don't know about adjusted float expressions
284284
adjust_float_expressions(goto_model);
@@ -344,7 +344,7 @@ void jdiff_parse_optionst::help()
344344
" --compact-output output dependencies in compact mode\n"
345345
"\n"
346346
"Program instrumentation options:\n"
347-
HELP_GOTO_CHECK
347+
HELP_GOTO_CHECK_JAVA
348348
HELP_COVER
349349
"Java Bytecode frontend options:\n"
350350
JAVA_BYTECODE_LANGUAGE_OPTIONS_HELP

jbmc/src/jdiff/jdiff_parse_options.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Author: Peter Schrammel
1212
#ifndef CPROVER_JDIFF_JDIFF_PARSE_OPTIONS_H
1313
#define CPROVER_JDIFF_JDIFF_PARSE_OPTIONS_H
1414

15-
#include <analyses/goto_check.h>
15+
#include <analyses/goto_check_java.h>
1616

1717
#include <util/parse_options.h>
1818
#include <util/timestamper.h>
@@ -29,7 +29,7 @@ class goto_modelt;
2929
"(json-ui)" \
3030
OPT_SHOW_GOTO_FUNCTIONS \
3131
OPT_SHOW_PROPERTIES \
32-
OPT_GOTO_CHECK \
32+
OPT_GOTO_CHECK_JAVA \
3333
OPT_COVER \
3434
"(verbosity):(version)" \
3535
"(no-lazy-methods)" /* should go away */ \

src/analyses/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ SRC = ai.cpp \
1313
flow_insensitive_analysis.cpp \
1414
global_may_alias.cpp \
1515
goto_check.cpp \
16+
goto_check_c.cpp \
17+
goto_check_java.cpp \
1618
goto_rw.cpp \
1719
guard_bdd.cpp \
1820
guard_expr.cpp \

0 commit comments

Comments
 (0)