From eacf7f7ccd40a56d1fe761d3d30ced6c6acd58da Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Nov 2018 13:00:16 +0200 Subject: Add support for rule-specific variables, use to fix cc.type data race --- build2/algorithm.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'build2/algorithm.cxx') diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx index fbeb365..b4f2843 100644 --- a/build2/algorithm.cxx +++ b/build2/algorithm.cxx @@ -434,11 +434,12 @@ namespace build2 // Match. // - // Clear the resolved targets list and the data pad before calling - // match(). The rule is free to modify these in its match() - // (provided that it matches) in order to, for example, convey some - // information to apply(). + // Clear the rule-specific variables, resolved targets list, and the + // data pad before calling match(). The rule is free to modify these + // in its match() (provided that it matches) in order to, for + // example, convey some information to apply(). // + s.vars.clear (); t.prerequisite_targets[a].clear (); if (a.inner ()) t.clear_data (); @@ -479,6 +480,7 @@ namespace build2 // As a sanity measure clear the target data since it can be incomplete // or invalid (mark()/unmark() should give you some ideas). // + s.vars.clear (); t.prerequisite_targets[a].clear (); if (a.inner ()) t.clear_data (); -- cgit v1.1