Skip to content

Commit 143b53e

Browse files
lucasccordeiropeterschrammel
authored andcommitted
a goal should be identified by a source_locationt
Signed-off-by: Lucas Cordeiro <[email protected]>
1 parent b128a59 commit 143b53e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/goto-instrument/cover.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,11 @@ Function: coverage_goalst::is_existing_goal
125125
126126
\*******************************************************************/
127127

128-
bool coverage_goalst::is_existing_goal(const char* goal)
128+
bool coverage_goalst::is_existing_goal(source_locationt source_location)
129129
{
130130
std::vector<std::string>::iterator it;
131-
it = find (existing_goals.begin(), existing_goals.end(), goal);
131+
it = find (existing_goals.begin(), existing_goals.end(),
132+
source_location.get_line().c_str());
132133

133134
if(it == existing_goals.end())
134135
return true;
@@ -1219,7 +1220,7 @@ void instrument_cover_goals(
12191220
basic_blocks.source_location_map[block_nr];
12201221

12211222
//check whether the current goal already exists
1222-
if(goals.is_existing_goal(source_location.get_line().c_str()) &&
1223+
if(goals.is_existing_goal(source_location) &&
12231224
!source_location.get_file().empty() &&
12241225
source_location.get_file()[0]!='<')
12251226
{

src/goto-instrument/cover.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class coverage_goalst
1717
{
1818
public:
1919
void set_goals(std::string goal);
20-
bool is_existing_goal(const char* goal);
20+
bool is_existing_goal(source_locationt source_location);
2121

2222
private:
2323
std::vector<std::string> existing_goals;

0 commit comments

Comments
 (0)