aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/common.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-11-01 13:00:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-11-01 13:00:16 +0200
commiteacf7f7ccd40a56d1fe761d3d30ced6c6acd58da (patch)
tree841a87d57720704654e8e8fa94cecd05c17b6cfa /build2/cc/common.cxx
parent8ba507252cb932023d16e5d4dfef267c039feb78 (diff)
Add support for rule-specific variables, use to fix cc.type data race
Diffstat (limited to 'build2/cc/common.cxx')
-rw-r--r--build2/cc/common.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/build2/cc/common.cxx b/build2/cc/common.cxx
index ae125a5..a1a17f7 100644
--- a/build2/cc/common.cxx
+++ b/build2/cc/common.cxx
@@ -80,9 +80,10 @@ namespace build2
// See what type of library this is (C, C++, etc). Use it do decide
// which x.libs variable name to use. If it's unknown, then we only
- // look into prerequisites.
+ // look into prerequisites. Note: lookup starting from rule-specific
+ // variables (target should already be matched).
//
- const string* t (cast_null<string> (l.vars[c_type]));
+ const string* t (cast_null<string> (l.state[a][c_type]));
bool impl (proc_impl && proc_impl (l, la));
bool cc (false), same (false);