It appears that FlattenToList is trying to do a Kahn topological sort. However, this does ...
12 years, 1 month ago
(2012-03-26 21:02:14 UTC)
#1
It appears that FlattenToList is trying to do a Kahn topological sort. However,
this does require the set of nodes with no incoming edges to be a set for
correctness. Otherwise it is possible for a node to be included more than once
in the final output list.
On 2012/03/26 21:05:50, Mark Mentovai wrote: > I didn’t think it was possible for there ...
12 years, 1 month ago
(2012-03-26 21:23:44 UTC)
#3
On 2012/03/26 21:05:50, Mark Mentovai wrote:
> I didn’t think it was possible for there to be duplicates in a list of
> dependents without it being a bug in the .gyp file. Are you seeing otherwise?
No, the dependents lists are all also sets (have no duplicates). However, this
is immaterial as the Kahn topological sort algorithm is incorrectly implemented
here. The issue is that it is possible that when executing the line which is now
in_degree_zeros.add(node_dependent)
that node_dependent may already be in in_degree_zeros. The node_dependent will
then show up more than once in flat_list. I don't have a good minimal example,
but it can happen.
Issue 5905070: Correct topological sort.
(Closed)
Created 12 years, 1 month ago by bungeman of chrome
Modified 12 years, 1 month ago
Reviewers: Mark Mentovai, bradnelson1
Base URL: http://gyp.googlecode.com/svn/trunk/
Comments: 0