Skip to content

goto-instrument/unwinding: enable unwinding assertions by default #8274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions doc/man/cbmc.1
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ allow malloc calls to return a null pointer
\fB\-\-malloc\-fail\-null\fR
set malloc failure mode to return null
.TP
\fB\-\-unwinding\-assertions\fR (\fBcbmc\fR\-only)
\fB\-\-unwinding\-assertions\fR
generate unwinding assertions (cannot be
used with \fB\-\-cover\fR)
.PP
Expand Down Expand Up @@ -108,9 +108,8 @@ disable signed arithmetic over\- and underflow checks
\fB\-\-no\-malloc\-may\-fail\fR
do not allow malloc calls to fail by default
.TP
\fB\-\-no\-unwinding\-assertions\fR (\fBcbmc\fR\-only)
do not generate unwinding assertions (cannot be
used with \fB\-\-cover\fR)
\fB\-\-no\-unwinding\-assertions\fR
do not generate unwinding assertions
.PP
If an already set flag is re-set, like calling \fB\-\-pointer\-check\fR
when default checks are already on, the flag is simply ignored.
Expand Down
6 changes: 5 additions & 1 deletion doc/man/goto-instrument.1
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,12 @@ read unwindset from file
\fB\-\-partial\-loops\fR
permit paths with partial loops
.TP
\fB\-\-no\-unwinding\-assertions\fR
do not generate unwinding assertions
.TP
\fB\-\-unwinding\-assertions\fR
generate unwinding assertions
generate unwinding assertions (enabled by default; overrides
\fB\-\-no\-unwinding\-assertions\fR when both of these are given)
.TP
\fB\-\-continue\-as\-loops\fR
add loop for remaining iterations after unwound part
Expand Down
2 changes: 1 addition & 1 deletion regression/goto-instrument/slice01/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--no-malloc-may-fail --unwind 2 --full-slice --add-library _ --no-standard-checks
--no-malloc-may-fail --unwind 2 --no-unwinding-assertions --full-slice --add-library _ --no-standard-checks
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
Expand Down
2 changes: 1 addition & 1 deletion regression/goto-instrument/slice08/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--full-slice --unwind 1
--full-slice --unwind 1 --no-unwinding-assertions
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
Expand Down
2 changes: 1 addition & 1 deletion regression/goto-instrument/slice16/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--full-slice --unwind 2
--full-slice --unwind 2 --no-unwinding-assertions
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
2 changes: 1 addition & 1 deletion regression/goto-instrument/unwind-assume2/test.desc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CORE
main.c
--unwind 9
--unwind 9 --no-unwinding-assertions
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
Expand Down
10 changes: 7 additions & 3 deletions src/goto-instrument/goto_instrument_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,11 @@ int goto_instrument_parse_optionst::doit()
ui_message_handler);
}

bool unwinding_assertions=cmdline.isset("unwinding-assertions");
bool partial_loops=cmdline.isset("partial-loops");
bool continue_as_loops=cmdline.isset("continue-as-loops");
bool partial_loops = cmdline.isset("partial-loops");
bool unwinding_assertions = cmdline.isset("unwinding-assertions") ||
(!continue_as_loops && !partial_loops &&
!cmdline.isset("no-unwinding-assertions"));
if(continue_as_loops)
{
if(unwinding_assertions)
Expand Down Expand Up @@ -1996,7 +1998,9 @@ void goto_instrument_parse_optionst::help()
HELP_UNWINDSET
" {y--unwindset-file_<file>} \t read unwindset from file\n"
" {y--partial-loops} \t permit paths with partial loops\n"
" {y--unwinding-assertions} \t generate unwinding assertions\n"
" {y--unwinding-assertions} \t generate unwinding assertions"
" (enabled by default)\n"
" {y--no-unwinding-assertions} \t do not generate unwinding assertions\n"
" {y--continue-as-loops} \t add loop for remaining iterations after"
" unwound part\n"
" {y--k-induction} {uk} \t check loops with k-induction\n"
Expand Down
1 change: 1 addition & 0 deletions src/goto-instrument/goto_instrument_parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Author: Daniel Kroening, [email protected]
OPT_UNWINDSET \
"(unwindset-file):" \
"(unwinding-assertions)(partial-loops)(continue-as-loops)" \
"(no-unwinding-assertions)" \
"(log):" \
"(call-graph)(reachable-call-graph)" \
OPT_INSERT_FINAL_ASSERT_FALSE \
Expand Down