mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
CTest: Ignore a checkpoint entry for a test that is not pending
CheckResume() reads the checkpoint `ctest -F` resumes from and removes each test it names. RemoveTest() erased the iterator std::find returned without checking it, so a checkpoint naming a test the current run does not have pending -- one written before the test list changed, say -- erased the end iterator of a std::list, which is undefined behavior. Skip such an entry instead.
This commit is contained in:
committed by
Brad King
parent
32b25b94d6
commit
4fcf3dd296
@@ -1638,8 +1638,13 @@ void cmCTestMultiProcessHandler::CheckResume()
|
||||
|
||||
void cmCTestMultiProcessHandler::RemoveTest(int index)
|
||||
{
|
||||
this->OrderedTests.erase(
|
||||
std::find(this->OrderedTests.begin(), this->OrderedTests.end(), index));
|
||||
auto const oi =
|
||||
std::find(this->OrderedTests.begin(), this->OrderedTests.end(), index);
|
||||
if (oi == this->OrderedTests.end()) {
|
||||
// The checkpoint names a test this run does not have pending.
|
||||
return;
|
||||
}
|
||||
this->OrderedTests.erase(oi);
|
||||
this->PendingTests.erase(index);
|
||||
this->Properties.erase(index);
|
||||
this->Completed++;
|
||||
|
||||
Reference in New Issue
Block a user