@@ -64,7 +64,8 @@ class basic_blockst
6464 format_number_ranget format_lines;
6565 for (const auto &cover_set : block_line_cover_map)
6666 {
67- assert (!cover_set.second .empty ());
67+ INVARIANT (!cover_set.second .empty (),
68+ " covered lines set must not be empty" );
6869 std::vector<unsigned >
6970 line_list{cover_set.second .begin (), cover_set.second .end ()};
7071
@@ -161,14 +162,20 @@ void coverage_goalst::add_goal(source_locationt goal)
161162 existing_goals.push_back (goal);
162163}
163164
164- bool coverage_goalst::is_existing_goal (source_locationt source_location) const
165+ // / compare the value of the current goal to the existing ones
166+ // / \param source_loc: source location of the current goal
167+ // / \return true : if the current goal exists false : otherwise
168+ bool coverage_goalst::is_existing_goal (source_locationt source_loc) const
165169{
166170 for (const auto &existing_loc : existing_goals)
167171 {
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 ;
172+ if ((source_loc.get_file ()==existing_loc.get_file ()) &&
173+ (source_loc.get_function ()==existing_loc.get_function ()) &&
174+ (source_loc.get_line ()==existing_loc.get_line ()) &&
175+ (source_loc.get_java_bytecode_index ().empty () ||
176+ (source_loc.get_java_bytecode_index ()==
177+ existing_loc.get_java_bytecode_index ())))
178+ return true ;
172179 }
173180 return false ;
174181}
0 commit comments