diff --git a/FWCore/Framework/src/PathsAndConsumesOfModules.cc b/FWCore/Framework/src/PathsAndConsumesOfModules.cc index ff4c083eeccbb..343015af93415 100644 --- a/FWCore/Framework/src/PathsAndConsumesOfModules.cc +++ b/FWCore/Framework/src/PathsAndConsumesOfModules.cc @@ -363,6 +363,18 @@ namespace edm { std::vector statusOfModules(largestIndex + 1); for (auto const& nameID : pathStatusInserterModuleLabelToModuleID) { statusOfModules[nameID.second].onPath_ = true; + unsigned int pathIndex; + auto const& paths = iPnC.paths(); + auto itFound = std::find(paths.begin(), paths.end(), nameID.first); + if (itFound != paths.end()) { + pathIndex = itFound - paths.begin(); + } else { + auto const& endPaths = iPnC.endPaths(); + itFound = std::find(endPaths.begin(), endPaths.end(), nameID.first); + assert(itFound != endPaths.end()); + pathIndex = itFound - endPaths.begin() + iPnC.paths().size(); + } + statusOfModules[nameID.second].pathsOn_.push_back(pathIndex); } if (kTriggerResultsIndex != kInvalidIndex) { statusOfModules[kTriggerResultsIndex] = std::move(triggerResultsStatus); diff --git a/FWCore/Framework/test/checkForModuleDependencyCorrectness_t.cppunit.cc b/FWCore/Framework/test/checkForModuleDependencyCorrectness_t.cppunit.cc index ae0e48814510b..752c3ce6a3c2c 100644 --- a/FWCore/Framework/test/checkForModuleDependencyCorrectness_t.cppunit.cc +++ b/FWCore/Framework/test/checkForModuleDependencyCorrectness_t.cppunit.cc @@ -264,6 +264,14 @@ void test_checkForModuleDependencyCorrectness::onePathHasCycleTest() { { PathToModules paths = {{"p", {"C", "B", "A"}}}; + CPPUNIT_ASSERT_THROW(testCase(md, paths), cms::Exception); + } + } + { + ModuleDependsOnMap md = {{"A", {"p"}}}; + { + PathToModules paths = {{"p", {"A"}}}; + CPPUNIT_ASSERT_THROW(testCase(md, paths), cms::Exception); } }