[repacker] enforce root node having no incoming edges.

This commit is contained in:
Garret Rieger 2022-12-01 23:37:16 +00:00
parent 30e405e470
commit de5a621322
2 changed files with 8 additions and 0 deletions

View File

@ -995,6 +995,10 @@ struct graph_t
{
update_parents();
if (root().parents)
// Root cannot have parents.
return false;
for (unsigned i = 0; i < root_idx (); i++)
{
if (!vertices_[i].parents)
@ -1061,6 +1065,10 @@ struct graph_t
parents_invalid = true;
update_parents();
if (root().parents) {
DEBUG_MSG (SUBSET_REPACK, nullptr, "Root node has incoming edges.");
}
for (unsigned i = 0; i < root_idx (); i++)
{
const auto& v = vertices_[i];