Skip empty DWARF code range when mapping lines

BUG=777

Change-Id: Ic6d05eee3ff4660b6d087999a8cea04a1ee3e92b
Reviewed-on: https://chromium-review.googlesource.com/c/1333507
Reviewed-by: Ted Mielczarek <ted.mielczarek@gmail.com>
This commit is contained in:
Ludovic Guegan 2018-11-13 13:00:07 +01:00 committed by Ted Mielczarek
parent 66571f4838
commit 12ecff373a

View file

@ -931,8 +931,9 @@ class FunctionRange {
Module::Function *function; Module::Function *function;
}; };
// Fills an array of ranges with pointers to the functions which owns them. // Fills an array of ranges with pointers to the functions which owns
// The array is sorted in ascending order and the ranges are non-overlapping. // them. The array is sorted in ascending order and the ranges are non
// empty and non-overlapping.
static void FillSortedFunctionRanges(vector<FunctionRange> &dest_ranges, static void FillSortedFunctionRanges(vector<FunctionRange> &dest_ranges,
vector<Module::Function *> *functions) { vector<Module::Function *> *functions) {
@ -946,9 +947,11 @@ static void FillSortedFunctionRanges(vector<FunctionRange> &dest_ranges,
ranges_it != ranges.cend(); ranges_it != ranges.cend();
++ranges_it) { ++ranges_it) {
FunctionRange range(*ranges_it, func); FunctionRange range(*ranges_it, func);
if (range.size != 0) {
dest_ranges.push_back(range); dest_ranges.push_back(range);
} }
} }
}
sort(dest_ranges.begin(), dest_ranges.end(), sort(dest_ranges.begin(), dest_ranges.end(),
[](const FunctionRange &fr1, const FunctionRange &fr2) { [](const FunctionRange &fr1, const FunctionRange &fr2) {