aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/bash/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-06-26 08:16:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-06-26 08:16:51 +0200
commit7fbc419525c76512b3fdc72987f636bec90554de (patch)
tree8690fcf83bc724fb39d15b1c9a957ecd7c1d12fd /libbuild2/bash/rule.cxx
parentef6bed5476d7b20aafd4a8a96945a5e603cc360e (diff)
Fix race in library metadata protocol
Specifically, we need to check whether the prerequisite_member is ad hoc before checking whether it is NULL because ad hoc ones are blanked out (set to NULL) during execute.
Diffstat (limited to 'libbuild2/bash/rule.cxx')
-rw-r--r--libbuild2/bash/rule.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/libbuild2/bash/rule.cxx b/libbuild2/bash/rule.cxx
index dd8940a..801f02c 100644
--- a/libbuild2/bash/rule.cxx
+++ b/libbuild2/bash/rule.cxx
@@ -237,7 +237,7 @@ namespace build2
const path* ap (nullptr);
for (const prerequisite_target& pt: t.prerequisite_targets[a])
{
- if (pt.target == nullptr || pt.adhoc)
+ if (pt.adhoc || pt.target == nullptr)
continue;
if (const bash* b = pt.target->is_a<bash> ())