Skip to content

Commit 211cb90

Browse files
Invoked full_slicer after generic property intrumentation
Invoked the full_slicer method just after generic property instrumentation so that CBMC can properly slice the program w.r.t. a given assertion in the program. Additionally, replaced returns from goto functions in goto_instrument_parse_options, as done similarly in cbmc_parse_options
1 parent 0139558 commit 211cb90

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

regression/goto-instrument/slice02/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33
--pointer-check --full-slice
44
^EXIT=0$

regression/goto-instrument/slice14/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
main.c
33
--pointer-check --full-slice
44
^EXIT=10$

src/cbmc/cbmc_parse_options.cpp

+8-7
Original file line numberDiff line numberDiff line change
@@ -900,13 +900,6 @@ bool cbmc_parse_optionst::process_goto_program(
900900
// Similar removal of RTTI inspection:
901901
remove_instanceof(symbol_table, goto_functions);
902902

903-
// full slice?
904-
if(cmdline.isset("full-slice"))
905-
{
906-
status() << "Performing a full slice" << eom;
907-
full_slicer(goto_functions, ns);
908-
}
909-
910903
// do partial inlining
911904
status() << "Partial Inlining" << eom;
912905
goto_partial_inline(goto_functions, ns, ui_message_handler);
@@ -920,6 +913,14 @@ bool cbmc_parse_optionst::process_goto_program(
920913
// add generic checks
921914
status() << "Generic Property Instrumentation" << eom;
922915
goto_check(ns, options, goto_functions);
916+
917+
// full slice?
918+
if(cmdline.isset("full-slice"))
919+
{
920+
status() << "Performing a full slice" << eom;
921+
full_slicer(goto_functions, ns);
922+
}
923+
923924
// checks don't know about adjusted float expressions
924925
adjust_float_expressions(goto_functions, ns);
925926

src/goto-instrument/goto_instrument_parse_options.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,7 @@ void goto_instrument_parse_optionst::instrument_goto_program()
14321432
// full slice?
14331433
if(cmdline.isset("full-slice"))
14341434
{
1435+
remove_returns(symbol_table, goto_functions);
14351436
do_indirect_call_and_rtti_removal();
14361437

14371438
status() << "Performing a full slice" << eom;

0 commit comments

Comments
 (0)