Skip to content

Commit 846a3e7

Browse files
committed
goto-instrument/unwinding: enable unwinding assertions by default
This will make behaviour consistent (and sound-by-default) across CBMC and goto-instrument.
1 parent ae7d311 commit 846a3e7

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

doc/man/cbmc.1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ allow malloc calls to return a null pointer
7979
\fB\-\-malloc\-fail\-null\fR
8080
set malloc failure mode to return null
8181
.TP
82-
\fB\-\-unwinding\-assertions\fR (\fBcbmc\fR\-only)
82+
\fB\-\-unwinding\-assertions\fR
8383
generate unwinding assertions (cannot be
8484
used with \fB\-\-cover\fR)
8585
.PP
@@ -108,9 +108,8 @@ disable signed arithmetic over\- and underflow checks
108108
\fB\-\-no\-malloc\-may\-fail\fR
109109
do not allow malloc calls to fail by default
110110
.TP
111-
\fB\-\-no\-unwinding\-assertions\fR (\fBcbmc\fR\-only)
112-
do not generate unwinding assertions (cannot be
113-
used with \fB\-\-cover\fR)
111+
\fB\-\-no\-unwinding\-assertions\fR
112+
do not generate unwinding assertions
114113
.PP
115114
If an already set flag is re-set, like calling \fB\-\-pointer\-check\fR
116115
when default checks are already on, the flag is simply ignored.

doc/man/goto-instrument.1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,12 @@ read unwindset from file
862862
\fB\-\-partial\-loops\fR
863863
permit paths with partial loops
864864
.TP
865+
\fB\-\-no\-unwinding\-assertions\fR
866+
do not generate unwinding assertions
867+
.TP
865868
\fB\-\-unwinding\-assertions\fR
866-
generate unwinding assertions
869+
generate unwinding assertions (enabled by default; overrides
870+
\fB\-\-no\-unwinding\-assertions\fR when both of these are given)
867871
.TP
868872
\fB\-\-continue\-as\-loops\fR
869873
add loop for remaining iterations after unwound part

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ int goto_instrument_parse_optionst::doit()
201201
ui_message_handler);
202202
}
203203

204-
bool unwinding_assertions=cmdline.isset("unwinding-assertions");
204+
bool unwinding_assertions = cmdline.isset("unwinding-assertions") ||
205+
!cmdline.isset("no-unwinding-assertions");
205206
bool partial_loops=cmdline.isset("partial-loops");
206207
bool continue_as_loops=cmdline.isset("continue-as-loops");
207208
if(continue_as_loops)
@@ -1996,7 +1997,9 @@ void goto_instrument_parse_optionst::help()
19961997
HELP_UNWINDSET
19971998
" {y--unwindset-file_<file>} \t read unwindset from file\n"
19981999
" {y--partial-loops} \t permit paths with partial loops\n"
1999-
" {y--unwinding-assertions} \t generate unwinding assertions\n"
2000+
" {y--unwinding-assertions} \t generate unwinding assertions"
2001+
" (enabled by default)\n"
2002+
" {y--no-unwinding-assertions} \t do not generate unwinding assertions\n"
20002003
" {y--continue-as-loops} \t add loop for remaining iterations after"
20012004
" unwound part\n"
20022005
" {y--k-induction} {uk} \t check loops with k-induction\n"

src/goto-instrument/goto_instrument_parse_options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Author: Daniel Kroening, [email protected]
6060
OPT_UNWINDSET \
6161
"(unwindset-file):" \
6262
"(unwinding-assertions)(partial-loops)(continue-as-loops)" \
63+
"(no-unwinding-assertions)" \
6364
"(log):" \
6465
"(call-graph)(reachable-call-graph)" \
6566
OPT_INSERT_FINAL_ASSERT_FALSE \

0 commit comments

Comments
 (0)