Skip to content

Commit 4a2a3f4

Browse files
committed
When --cover is used switch off unwinding-assertions
As the default is now to switch on the unwinding-assertions, we don't want a user to have to specify `--no-unwinding-assertions` in order to use `--cover`.
1 parent b2774ef commit 4a2a3f4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/cbmc/cbmc_parse_options.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,7 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
143143
if(cmdline.isset("function"))
144144
options.set_option("function", cmdline.get_value("function"));
145145

146-
if(
147-
cmdline.isset("cover") &&
148-
// The option is set by default, or passed in the by the user.
149-
(options.get_bool_option("unwinding-assertions") ||
150-
cmdline.isset("unwinding-assertions")))
146+
if(cmdline.isset("cover") && cmdline.isset("unwinding-assertions"))
151147
{
152148
log.error()
153149
<< "--cover and --unwinding-assertions must not be given together"
@@ -204,7 +200,13 @@ void cbmc_parse_optionst::get_command_line_options(optionst &options)
204200
options.set_option("show-vcc", true);
205201

206202
if(cmdline.isset("cover"))
203+
{
207204
parse_cover_options(cmdline, options);
205+
// The default unwinding assertions option needs to be switched off when
206+
// performing coverage checks because we intend to solve for coverage rather
207+
// than assertions.
208+
options.set_option("unwinding-assertions", false);
209+
}
208210

209211
if(cmdline.isset("mm"))
210212
options.set_option("mm", cmdline.get_value("mm"));

0 commit comments

Comments
 (0)