From d3ef150c45d9325bc075d33a00c8cf0a6b1bf954 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 20 Jul 2023 10:17:03 +0200 Subject: Consider unmatched prerequisites in updated_during_match() check --- libbuild2/dyndep.cxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'libbuild2/dyndep.cxx') diff --git a/libbuild2/dyndep.cxx b/libbuild2/dyndep.cxx index c0360f0..e6d0643 100644 --- a/libbuild2/dyndep.cxx +++ b/libbuild2/dyndep.cxx @@ -70,19 +70,21 @@ namespace build2 { const prerequisite_target& p (pts[i]); - // @@ This currently doesn't cover adhoc targets if matched with - // buildscript (it stores them in p.data). Probably need to redo - // things there (see adhoc_buildscript_rule::apply()). + // If include_target flag is specified, then p.data contains the + // target pointer. // - if (p.target != nullptr) + if (const target* xt = + (p.target != nullptr ? p.target : + ((p.include & prerequisite_target::include_target) != 0 + ? reinterpret_cast (p.data) + : nullptr))) { - if (p.target == &pt && - (p.include & prerequisite_target::include_udm) != 0) + if (xt == &pt && (p.include & prerequisite_target::include_udm) != 0) return true; - if (size_t n = p.target->prerequisite_targets[a].size ()) + if (size_t n = xt->prerequisite_targets[a].size ()) { - if (updated_during_match (a, *p.target, n, pt)) + if (updated_during_match (a, *xt, n, pt)) return true; } } -- cgit v1.1