Get*Union: disallow nulltpr Refs

This commit is contained in:
Greg Sanders
2025-03-31 13:05:20 -04:00
parent 57433502e6
commit a40bd374aa
2 changed files with 4 additions and 2 deletions

View File

@@ -1595,6 +1595,7 @@ std::vector<TxGraph::Ref*> TxGraphImpl::GetAncestorsUnion(std::span<const Ref* c
std::vector<std::pair<Cluster*, DepGraphIndex>> matches;
matches.reserve(args.size());
for (auto arg : args) {
Assume(arg);
// Skip empty Refs.
if (GetRefGraph(*arg) == nullptr) continue;
Assume(GetRefGraph(*arg) == this);
@@ -1627,6 +1628,7 @@ std::vector<TxGraph::Ref*> TxGraphImpl::GetDescendantsUnion(std::span<const Ref*
std::vector<std::pair<Cluster*, DepGraphIndex>> matches;
matches.reserve(args.size());
for (auto arg : args) {
Assume(arg);
// Skip empty Refs.
if (GetRefGraph(*arg) == nullptr) continue;
Assume(GetRefGraph(*arg) == this);