Skip to content

Commit 340a5ff

Browse files
author
Daniel Kroening
authored
Merge pull request #833 from tautschnig/fix-built-in-assertions
Configure built-in-assertions for all callers of goto_check
2 parents 38ffa4c + 554605b commit 340a5ff

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/analyses/goto_check.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void goto_check(
3333
"(bounds-check)(pointer-check)(memory-leak-check)" \
3434
"(div-by-zero-check)(signed-overflow-check)(unsigned-overflow-check)" \
3535
"(pointer-overflow-check)(conversion-check)(undefined-shift-check)" \
36-
"(float-overflow-check)(nan-check)"
36+
"(float-overflow-check)(nan-check)(no-built-in-assertions)"
3737

3838
#define HELP_GOTO_CHECK \
3939
" --bounds-check enable array bounds checks\n" \
@@ -47,6 +47,7 @@ void goto_check(
4747
" --undefined-shift-check check shift greater than bit-width\n" \
4848
" --float-overflow-check check floating-point for +/-Inf\n" \
4949
" --nan-check check floating-point for NaN\n" \
50+
" --no-built-in-assertions ignore assertions in built-in library\n" \
5051

5152
#define PARSE_OPTIONS_GOTO_CHECK(cmdline, options) \
5253
options.set_option("bounds-check", cmdline.isset("bounds-check")); \
@@ -59,6 +60,7 @@ void goto_check(
5960
options.set_option("conversion-check", cmdline.isset("conversion-check")); \
6061
options.set_option("undefined-shift-check", cmdline.isset("undefined-shift-check")); /* NOLINT(whitespace/line_length) */ \
6162
options.set_option("float-overflow-check", cmdline.isset("float-overflow-check")); /* NOLINT(whitespace/line_length) */ \
62-
options.set_option("nan-check", cmdline.isset("nan-check"))
63+
options.set_option("nan-check", cmdline.isset("nan-check")); \
64+
options.set_option("built-in-assertions", !cmdline.isset("no-built-in-assertions")) /* NOLINT(whitespace/line_length) */
6365

6466
#endif // CPROVER_ANALYSES_GOTO_CHECK_H

src/cbmc/cbmc_parse_options.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,6 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
237237
else
238238
options.set_option("assertions", true);
239239

240-
// check built-in assertions
241-
if(cmdline.isset("no-built-in-assertions"))
242-
options.set_option("built-in-assertions", false);
243-
else
244-
options.set_option("built-in-assertions", true);
245-
246240
// use assumptions
247241
if(cmdline.isset("no-assumptions"))
248242
options.set_option("assumptions", false);
@@ -1124,7 +1118,6 @@ void cbmc_parse_optionst::help()
11241118
"Program instrumentation options:\n"
11251119
HELP_GOTO_CHECK
11261120
" --no-assertions ignore user assertions\n"
1127-
" --no-built-in-assertions ignore assertions in built-in library\n"
11281121
" --no-assumptions ignore user assumptions\n"
11291122
" --error-label label check that label is unreachable\n"
11301123
" --cover CC create test-suite with coverage criterion CC\n" // NOLINT(*)

0 commit comments

Comments
 (0)