Skip to content

Commit a2f4ab3

Browse files
smowtonpeterschrammel
authored andcommitted
Coverage (branch mode): add missing is-current-function test (diffblue#781)
With `--cover-function-only`, all coverage tests should be conditional on the function containing the target matching `--function`; however this particular case got missed out.
1 parent e610c08 commit a2f4ab3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/goto-instrument/cover.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ void instrument_cover_goals(
14111411
t->source_location.set_function(i_it->function);
14121412
}
14131413

1414-
if(i_it->is_goto() && !i_it->guard.is_true())
1414+
if(i_it->is_goto() && !i_it->guard.is_true() && cover_curr_function)
14151415
{
14161416
std::string b=std::to_string(basic_blocks[i_it]);
14171417
std::string true_comment=

0 commit comments

Comments
 (0)