diff options
author | Vedant Kumar <vsk@apple.com> | 2016-09-09 18:44:40 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2016-09-09 18:44:40 +0000 |
commit | c236e5a0f1b9b8118428bec5a7adf3e3efc86cf1 (patch) | |
tree | 9db52be9875bcc375a61093283d7ad47f0369cbf /llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp | |
parent | 627d78f6c2c19e3539193213fd9700c697991acf (diff) | |
download | bcm5719-llvm-c236e5a0f1b9b8118428bec5a7adf3e3efc86cf1.tar.gz bcm5719-llvm-c236e5a0f1b9b8118428bec5a7adf3e3efc86cf1.zip |
[llvm-cov] Remove some asserts in the html renderer (NFC)
These asserts are making tests fragile. The renderer does not enter an
invalid state when they fail, however, it may spit out a garbled
coverage report because the source text no longer matches the provided
coverage mapping.
Another follow-up to r281072.
llvm-svn: 281076
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp')
-rw-r--r-- | llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp index 1c078ee94ea..d05bbdca517 100644 --- a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp +++ b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp @@ -473,21 +473,17 @@ void SourceCoverageViewHTML::renderLine( unsigned LCol = 1; auto Snip = [&](unsigned Start, unsigned Len) { - assert(Start + Len <= Line.size() && "Snippet extends past the EOL"); Snippets.push_back(Line.substr(Start, Len)); LCol += Len; }; Snip(LCol - 1, Segments.empty() ? 0 : (Segments.front()->Col - 1)); - for (unsigned I = 1, E = Segments.size(); I < E; ++I) { - assert(LCol == Segments[I - 1]->Col && "Snippet start position is wrong"); + for (unsigned I = 1, E = Segments.size(); I < E; ++I) Snip(LCol - 1, Segments[I]->Col - LCol); - } // |Line| + 1 is needed to avoid underflow when, e.g |Line| = 0 and LCol = 1. Snip(LCol - 1, Line.size() + 1 - LCol); - assert(LCol == Line.size() + 1 && "Final snippet doesn't reach the EOL"); // 2. Escape all of the snippets. |