summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2012-05-01 21:32:23 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2012-05-01 21:32:23 (GMT)
commitf5c5db0753161726c6032178bb10eb41b1ddde02 (patch)
treed1461f51c4c9cad969623f17950d9ecbfcb6c9d1 /Source/CTest
parent7955e995ec400fb063529064b6232ca0eedfe5e0 (diff)
downloadCMake-f5c5db0753161726c6032178bb10eb41b1ddde02.zip
CMake-f5c5db0753161726c6032178bb10eb41b1ddde02.tar.gz
CMake-f5c5db0753161726c6032178bb10eb41b1ddde02.tar.bz2
Fix some warnings and a bug where it went past the length of a vector.
Fix a kwstyle warning and an unused variable warning. Also fix a case where it could crash because a vector was referenced passed its end.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmParseCacheCoverage.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/CTest/cmParseCacheCoverage.cxx b/Source/CTest/cmParseCacheCoverage.cxx
index d2ff404..fb85810 100644
--- a/Source/CTest/cmParseCacheCoverage.cxx
+++ b/Source/CTest/cmParseCacheCoverage.cxx
@@ -7,8 +7,9 @@
#include <cmsys/Glob.hxx>
-cmParseCacheCoverage::cmParseCacheCoverage(cmCTestCoverageHandlerContainer& cont,
- cmCTest* ctest)
+cmParseCacheCoverage::cmParseCacheCoverage(
+ cmCTestCoverageHandlerContainer& cont,
+ cmCTest* ctest)
:cmParseMumpsCoverage(cont, ctest)
{
}
@@ -101,7 +102,6 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file)
}
std::string routine;
std::string filepath;
- bool foundFile = false;
while(cmSystemTools::GetLineFromStream(in, line))
{
// clear out line argument vector
@@ -181,6 +181,13 @@ bool cmParseCacheCoverage::ReadCMCovFile(const char* file)
continue; // skip setting count to avoid crash
}
// now add to count for linenumber
+ // for some reason the cache coverage adds extra lines to the
+ // end of the file in some cases. Since they do not exist, we will
+ // mark them as non executable
+ while(linenumber >= coverageVector.size())
+ {
+ coverageVector.push_back(-1);
+ }
coverageVector[linenumber] += count;
}
return true;