Don't crash on cyclic references between rule bindings.
authorNico Weber <nicolasweber@gmx.de>
Wed, 18 Mar 2015 20:54:16 +0000 (16:54 -0400)
committerNico Weber <nicolasweber@gmx.de>
Sat, 21 Mar 2015 15:15:41 +0000 (08:15 -0700)
commiteb7167d456b8ef2dad3846ca2ba6438b060518c9
tree041c666e665178ba6a8db7235f8dc697d9ceafc7
parent403c9194af07f11a14a5d8416b6eaf4ad7b84a7e
Don't crash on cyclic references between rule bindings.

Fixes #902.

This dynamically detects cycles.  I like this approach less than
detecting them statically when parsing rules [1], but it has the
advantage that it doesn't break existing ninja manifest files.

It has the disadvantage that it slows down manifest_parser_perftest by
3.9%.

1: https://github.com/martine/ninja/commit/cc6f54d6d436047
src/graph.cc