Skip to content

Commit b531025

Browse files
lucasccordeirotautschnig
authored andcommitted
a goal should be identified by a source_locationt
Signed-off-by: Lucas Cordeiro <[email protected]>
1 parent ac90923 commit b531025

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/goto-instrument/cover.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ class basic_blockst
104104

105105
bool coverage_goalst::is_existing_goal(source_locationt source_location)
106106
{
107-
std::vector<std::string>::iterator it;
108-
it = find (existing_goals.begin(), existing_goals.end(),
109-
source_location.get_line().c_str());
110-
107+
std::vector<source_locationt>::iterator it = existing_goals.begin();
108+
while (it!=existing_goals.end())
109+
{
110+
if (!source_location.get_line().compare(it->get_line()))
111+
break;
112+
++it;
113+
}
111114
if(it == existing_goals.end())
112115
return true;
113116
else

src/goto-instrument/cover.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ class coverage_goalst
2424
public:
2525
void get_coverage(const std::string &coverage,
2626
message_handlert &message_handler);
27-
void set_goals(std::string goal);
27+
void set_goals(source_locationt goal);
2828
bool is_existing_goal(source_locationt source_location);
2929

3030
private:
31-
std::vector<std::string> existing_goals;
31+
std::vector<source_locationt> existing_goals;
3232
};
3333

3434
enum class coverage_criteriont

0 commit comments

Comments
 (0)