aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-04-26 18:22:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-04-26 18:22:43 +0200
commit3880c3dd8670cc4a7ea5d4bd354c4f26f0278785 (patch)
tree9326c781f6c581caec01191bc1dc7d06446580f2
parent0f26bc3b825a8711a4f8c60b5ab746cba9d93bd7 (diff)
Fix bug in backlinking test
-rw-r--r--build2/algorithm.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx
index a3f4d0a..6f756e4 100644
--- a/build2/algorithm.cxx
+++ b/build2/algorithm.cxx
@@ -1070,15 +1070,16 @@ namespace build2
if (!t.out.empty () || !t.is_a<file> ())
return false;
- // An in-src configuration cannot be forwarded.
+ // Neither an out-of-project nor in-src configuration can be forwarded.
//
const scope& bs (t.base_scope ());
- if (bs.src_path () == bs.out_path ())
+ const scope* rs (bs.root_scope ());
+ if (rs == nullptr || bs.src_path () == bs.out_path ())
return false;
// Only for forwarded configurations.
//
- if (!cast_false<bool> (bs.root_scope ()->vars[var_forwarded]))
+ if (!cast_false<bool> (rs->vars[var_forwarded]))
return false;
lookup l (t[var_backlink]);