Skip to content

Commit 7583da2

Browse files
authored
Merge pull request #1056 from diffblue/smowton/cleanup/remove_skip_before_cover_annotation
Remove skips before cover annotation
2 parents d68f137 + 33fc907 commit 7583da2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/cbmc/cbmc_parse_options.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,10 @@ bool cbmc_parse_optionst::process_goto_program(
887887
remove_unused_functions(goto_functions, ui_message_handler);
888888
}
889889

890+
// remove skips such that trivial GOTOs are deleted and not considered
891+
// for coverage annotation:
892+
remove_skip(goto_functions);
893+
890894
// instrument cover goals
891895
if(cmdline.isset("cover"))
892896
{
@@ -915,7 +919,7 @@ bool cbmc_parse_optionst::process_goto_program(
915919
full_slicer(goto_functions, ns);
916920
}
917921

918-
// remove skips
922+
// remove any skips introduced since coverage instrumentation
919923
remove_skip(goto_functions);
920924
goto_functions.update();
921925
}

src/symex/symex_parse_options.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Author: Daniel Kroening, [email protected]
3434
#include <goto-programs/goto_inline.h>
3535
#include <goto-programs/xml_goto_trace.h>
3636
#include <goto-programs/remove_complex.h>
37+
#include <goto-programs/remove_skip.h>
3738
#include <goto-programs/remove_vector.h>
3839
#include <goto-programs/remove_virtual_functions.h>
3940
#include <goto-programs/remove_exceptions.h>
@@ -321,6 +322,10 @@ bool symex_parse_optionst::process_goto_program(const optionst &options)
321322
remove_unused_functions(goto_model.goto_functions, ui_message_handler);
322323
}
323324

325+
// remove skips such that trivial GOTOs are deleted and not considered
326+
// for coverage annotation:
327+
remove_skip(goto_model.goto_functions);
328+
324329
if(cmdline.isset("cover"))
325330
{
326331
std::string criterion=cmdline.get_value("cover");

0 commit comments

Comments
 (0)