From 7fbc419525c76512b3fdc72987f636bec90554de Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 Jun 2020 08:16:51 +0200 Subject: 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. --- libbuild2/bash/rule.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libbuild2/bash') 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 ()) -- cgit v1.1