File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -161,14 +161,20 @@ void coverage_goalst::add_goal(source_locationt goal)
161
161
existing_goals.push_back (goal);
162
162
}
163
163
164
- bool coverage_goalst::is_existing_goal (source_locationt source_location) const
164
+ // / compare the value of the current goal to the existing ones
165
+ // / \param source_loc: source location of the current goal
166
+ // / \return true : if the current goal exists false : otherwise
167
+ bool coverage_goalst::is_existing_goal (source_locationt source_loc) const
165
168
{
166
169
for (const auto &existing_loc : existing_goals)
167
170
{
168
- if (source_location.get_file ()==existing_loc.get_file () &&
169
- source_location.get_function ()==existing_loc.get_function () &&
170
- source_location.get_line ()==existing_loc.get_line ())
171
- return true ;
171
+ if ((source_loc.get_file ()==existing_loc.get_file ()) &&
172
+ (source_loc.get_function ()==existing_loc.get_function ()) &&
173
+ (source_loc.get_line ()==existing_loc.get_line ()) &&
174
+ (source_loc.get_java_bytecode_index ().empty () ||
175
+ (source_loc.get_java_bytecode_index ()==
176
+ existing_loc.get_java_bytecode_index ())))
177
+ return true ;
172
178
}
173
179
return false ;
174
180
}
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class coverage_goalst
25
25
message_handlert &message_handler,
26
26
coverage_goalst &goals);
27
27
void add_goal (source_locationt goal);
28
- bool is_existing_goal (source_locationt source_location ) const ;
28
+ bool is_existing_goal (source_locationt source_loc ) const ;
29
29
30
30
private:
31
31
std::vector<source_locationt> existing_goals;
You can’t perform that action at this time.
0 commit comments