diff options
author | Jan Niklas Hasse <jhasse@bixense.com> | 2019-12-27 21:03:52 (GMT) |
---|---|---|
committer | Jan Niklas Hasse <jhasse@bixense.com> | 2019-12-27 21:03:52 (GMT) |
commit | 1f02bc192a31ec2daac813c11d98dd939848d40f (patch) | |
tree | 76abebc7fabb957d495bb8ee2ff0e8cba0b63ce3 | |
parent | 35169ddf478c2d18e4ce4bbd006f08bca5e21095 (diff) | |
download | Ninja-1f02bc192a31ec2daac813c11d98dd939848d40f.zip Ninja-1f02bc192a31ec2daac813c11d98dd939848d40f.tar.gz Ninja-1f02bc192a31ec2daac813c11d98dd939848d40f.tar.bz2 |
Fix logic-error in IsPathDead, see #1432
The conditional `(!n || !n->in_edge()) && ` was moved up. It now needs
to be inversed because there's a `return false;`. See
https://github.com/ninja-build/ninja/commit/3beebde51a2089ecb01820f1428efe0263deaeea#diff-78294872cbf9d32f4f972288561fa718R146
and
https://github.com/ninja-build/ninja/pull/1432#discussion_r321827528
-rw-r--r-- | src/ninja.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ninja.cc b/src/ninja.cc index f39d1a6..19646d9 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -154,7 +154,7 @@ struct NinjaMain : public BuildLogUser { virtual bool IsPathDead(StringPiece s) const { Node* n = state_.LookupNode(s); - if (!n || !n->in_edge()) + if (n && n->in_edge()) return false; // Just checking n isn't enough: If an old output is both in the build log // and in the deps log, it will have a Node object in state_. (It will also |