[repacker] enforce root node having no incoming edges.
This commit is contained in:
parent
30e405e470
commit
de5a621322
|
@ -995,6 +995,10 @@ struct graph_t
|
||||||
{
|
{
|
||||||
update_parents();
|
update_parents();
|
||||||
|
|
||||||
|
if (root().parents)
|
||||||
|
// Root cannot have parents.
|
||||||
|
return false;
|
||||||
|
|
||||||
for (unsigned i = 0; i < root_idx (); i++)
|
for (unsigned i = 0; i < root_idx (); i++)
|
||||||
{
|
{
|
||||||
if (!vertices_[i].parents)
|
if (!vertices_[i].parents)
|
||||||
|
@ -1061,6 +1065,10 @@ struct graph_t
|
||||||
parents_invalid = true;
|
parents_invalid = true;
|
||||||
update_parents();
|
update_parents();
|
||||||
|
|
||||||
|
if (root().parents) {
|
||||||
|
DEBUG_MSG (SUBSET_REPACK, nullptr, "Root node has incoming edges.");
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < root_idx (); i++)
|
for (unsigned i = 0; i < root_idx (); i++)
|
||||||
{
|
{
|
||||||
const auto& v = vertices_[i];
|
const auto& v = vertices_[i];
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue