File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -173,11 +173,14 @@ int Checkable::GetAllChildrenCount(int rstack) const
173173 return 0 ;
174174 }
175175
176+ std::set<Checkable*> seenChildren; // To avoid false positives in case of duplicated dependencies.
176177 int count = 0 ;
177178 // Actually, incrementing the rstack should be done once outside the loop here, but since IsReachable()
178179 // applies the limit the exact same way, it should be fine to limit the sum of calls to 256 here as well.
179180 for (auto & dependency: GetReverseDependencies ()) {
180- count += dependency->GetChild ()->GetAllChildrenCount (rstack + 1 ) + 1 ;
181+ if (auto child (dependency->GetChild ()); seenChildren.insert (child.get ()).second ) {
182+ count += child->GetAllChildrenCount (rstack + 1 ) + 1 ;
183+ }
181184 }
182185
183186 return count;
You can’t perform that action at this time.
0 commit comments