aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/compile-rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-11-18 15:11:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-11-18 15:11:53 +0200
commitc28bb7c4038916d359228317d4ef5fe17dabce61 (patch)
tree834d7c1768138b60e42d4d5d73d7a778a6a34932 /libbuild2/cc/compile-rule.cxx
parent4f8ce9ca52f8bd967ac4e656e24e4f33584abd22 (diff)
Add couple of sanity checks
Diffstat (limited to 'libbuild2/cc/compile-rule.cxx')
-rw-r--r--libbuild2/cc/compile-rule.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx
index 6e21a7e..da958f4 100644
--- a/libbuild2/cc/compile-rule.cxx
+++ b/libbuild2/cc/compile-rule.cxx
@@ -779,7 +779,7 @@ namespace build2
// t.prerequisite_targets since we used standard search() and match()
// above.
//
- const file& src (*md.src.search (t).is_a<file> ());
+ const file& src (*md.src.load (memory_order_relaxed)->is_a<file> ());
// Figure out if __symexport is used. While normally it is specified
// on the project root (which we cached), it can be overridden with
@@ -892,8 +892,13 @@ namespace build2
// Finally the source file.
//
- if (dd.expect (src.path ()) != nullptr)
- l4 ([&]{trace << "source file mismatch forcing update of " << t;});
+ {
+ const path& p (src.path ());
+ assert (!p.empty ()); // Sanity check.
+
+ if (dd.expect (p) != nullptr)
+ l4 ([&]{trace << "source file mismatch forcing update of " << t;});
+ }
// If any of the above checks resulted in a mismatch (different
// compiler, options, or source file) or if the depdb is newer than